You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
serverURL=flag.String("server_url", "https://localhost:8080", "URL (with protocol and port of osquery server)")
2855
-
enrollSecret=flag.String("enroll_secret", "", "Enroll secret to authenticate enrollment")
2856
-
hostCount=flag.Int("host_count", 10, "Number of hosts to start (default 10)")
2857
-
randSeed=flag.Int64("seed", time.Now().UnixNano(), "Seed for random generator (default current time)")
2858
-
startPeriod=flag.Duration("start_period", 10*time.Second, "Duration to spread start of hosts over")
2859
-
configInterval=flag.Duration("config_interval", 1*time.Minute, "Interval for config requests")
2888
+
serverURL=flag.String("server_url", "https://localhost:8080", "URL (with protocol and port of osquery server)")
2889
+
enrollSecret=flag.String("enroll_secret", "", "Enroll secret to authenticate enrollment")
2890
+
hostCount=flag.Int("host_count", 10, "Number of hosts to start (default 10)")
2891
+
totalHostCount=flag.Int("total_host_count", 0, "Total number of hosts across all containers (if 0, uses host_count)")
2892
+
hostIndexOffset=flag.Int("host_index_offset", 0, "Starting index offset for this container's hosts (default 0)")
2893
+
randSeed=flag.Int64("seed", time.Now().UnixNano(), "Seed for random generator (default current time)")
2894
+
startPeriod=flag.Duration("start_period", 10*time.Second, "Duration to spread start of hosts over")
2895
+
configInterval=flag.Duration("config_interval", 1*time.Minute, "Interval for config requests")
2860
2896
// Flag logger_tls_period defines how often to check for sending scheduled query results.
2861
2897
// osquery-perf will send log requests with results only if there are scheduled queries configured AND it's their time to run.
2862
2898
logInterval=flag.Duration("logger_tls_period", 10*time.Second, "Interval for scheduled queries log requests")
@@ -2947,6 +2983,20 @@ func main() {
2947
2983
flag.Parse()
2948
2984
rand.Seed(*randSeed)
2949
2985
2986
+
// There are two modes for osquery-perf:
2987
+
// 1. Non distributed mode (old behavior). All agents get all software specified. This is done when specifying --host_count and --common_software_count
2988
+
// Example --host_count 500 --common_software_count 1000 -> means 500 hosts each with 1000 pieces of software
2989
+
// 2. Distributed mode. All agents get a subset of the total software specified. This is done when specifying --total_host_count and --host_index_offset along with other params.
2990
+
// Example --host_count 500 --common_software_count 1000 --total_host_count 5000 --host_index_offset [0...N...1000]
2991
+
// This example means that each container will run 500 hosts, but each host will only get a subset of the total 5000 software requested.
2992
+
if*totalHostCount>0&&*totalHostCount>*hostCount {
2993
+
log.Printf("WARNING: total_host_count (%d) > host_count (%d). You are trying to use distributed mode, ensure you have --host_index_offset specified for each container", *totalHostCount, *hostCount)
2994
+
log.Printf(" Container 0 should use: --host_index_offset 0")
2995
+
log.Printf(" Container 1 should use: --host_index_offset %d", *hostCount)
2996
+
log.Printf(" Container 2 should use: --host_index_offset %d", *hostCount*2)
2997
+
log.Printf(" Container N should use: --host_index_offset Y")
2998
+
}
2999
+
2950
3000
if*onlyAlreadyEnrolled {
2951
3001
// Orbit enrollment does not support the "already enrolled" mode at the
0 commit comments