Skip to main content
Version: 1.x

commands-and-options

Command Reference​

These are the commands that are available in Surfmeter Automator.

You can run them by typing them in the command line. For example, to register a client, you would run:

./surfmeter-automator-headless register --registrationKey <your-registration-key>

Here is the full list of commands:

CommandDescription
registerregister the client
startStudystart a study
setPublicConfigset the public config
getPublicConfigget the current public config and write it to a file
reloadExtensionFromDiskreload the extension from disk
checkRegistrationcheck the registration state
listStudyIdslist the available study IDs in the public config
launchlaunch Chrome
updateExtensionupdate Surfmeter extension
updateConfigupdate config
updateSelfupdate Surfmeter Automator
loadScheduleload the cron schedule
clearScheduleclear any cron schedule
unregisterunregister the client, deleting the profile and cache
clearLockfileclear the Surfmeter lockfile and Chrome profile singleton locks (use with caution)
flushDbToServerflush the local database to the server (send previously failed measurements)
cleanupProfilecleanup the profile (remove all unnecessary files)
setLabelset the label for the current client
setTagsset the tags for the current client

Option Reference​

The options are mostly self-explanatory and shown when you run --help.

Overriding Options via Environment Variables​

Any option from the tables below can also be set through an environment variable named SURFMETER_OPTIONS__<OPTION_NAME>, where <OPTION_NAME> is the option's name in SCREAMING_SNAKE_CASE. For example, --enableGpu becomes SURFMETER_OPTIONS__ENABLE_GPU=1, and --studyTimeout becomes SURFMETER_OPTIONS__STUDY_TIMEOUT=600. This is the highest-priority source and wins over command-line flags and flags baked into scheduled jobs.

To turn off a behavior that is on by default, use the explicit no* option, for example SURFMETER_OPTIONS__NO_LOG_NETWORK_REQUESTS=1.

See Overriding Options via Environment Variables for the accepted values, coercion rules, and how to set array and object options.

General Options​

These apply to all commands.

OptionTypeDescription
--additionalExtensionsarrayPath to additional extension directories (extracted)
--autoOpenDevtoolsbooleanAutomatically open DevTools for all tabs (default: false)
--chromeArgsarrayAdditional Chrome command line arguments (feature flags will be merged with existing ones)
--chromeBinarystringAlternative path to the Chrome binary (defaults to the one found in $PATH; Chrome-based studies only)
--chromeDriverBinarystringAlternative path to the ChromeDriver binary (defaults to the one found in $PATH; Chrome-based studies only)
--configDirstringPath to the config directory containing the automatorConfig.json file
--deeplinkLoadTimeoutnumberWait for how many seconds to detect Surfmeter Lab startup (default: 60)
--deeplinkWaitTimeoutnumberWait for how many seconds to get deep link status (default: 60)
--enableGpubooleanEnable GPU support for Chrome (default: false)
--enableSandboxbooleanRun Chrome with its sandbox enabled instead of passing --no-sandbox (default: false)
--extensionDirstringPath to the Surfmeter extension (extracted)
--globalTimeoutnumberWait for how many seconds before exiting Automator (default: 600)
--globalTimeoutGracePeriodnumberWait for how many seconds after the global timeout before forcefully exiting without sending a report (default: 10)
--headlessbooleanUse the built-in headless mode for all instances of Chrome (default: false)
--iWantToDangerouslyUseRootbooleanAllow running the Automator as root, which is unsupported and breaks file ownership (default: false)
--keepNetworkRequestsbooleanKeep all logged network requests instead of deleting them after the study (default: false)
--lockfileDirstringDirectory to use for lockfile
--lockfileWaitTimeoutnumberWait for how many seconds to get lockfile status (default: 15)
--logConsoleMessagesbooleanLog all console message via the Chrome DevTools Protocol to the console (default: false)
--noAutoSetPublicConfigbooleanDo not automatically set the public config (i.e., always use the public config in the extension) (default: false)
--noClearCachebooleanDo not clear caches when starting Chrome (default: false)
--noClearCookiesbooleanDo not clear cookies when starting Chrome (preserves logins) (default: false)
--noClearSystemDnsbooleanDo not clear the system DNS when starting (default: false)
--noClosebooleanDo not close the browser at the end of a run (default: false)
--noDisableNetworkCachebooleanDo not disable the network cache for individual requests (default: false)
--noLoadSurfmeterLabbooleanDo not load Surfmeter Lab extension (default: false)
--noLogNetworkRequestsbooleanDo not log network requests via the Chrome DevTools Protocol. By default, all network requests are logged into a temporary file to enable additional statistics for content servers. (default: false)
--noQuicbooleanDo not let Chrome use QUIC/HTTP3, forcing all traffic onto TCP with HTTP/2 or HTTP/1.1 (default: false)
--profileDirstringPath to the Chrome profile to use
--publicConfigFilestringPath to the Public Config JSON file (used by the getPublicConfig/setPublicConfig command and when starting a study)
--sendByteCountReportbooleanSend byte count reports (bytes transferred over time, plus throughput statistics) to the server. (default: false)
--sendNetworkPerformanceReportsbooleanSend network performance reports to the server. (default: false)
--sendNetworkRequestsbooleanSend all network requests to the server. Note that this causes a lot of network traffic. (default: false)
--userAgentstringOverride the user agent when starting the browser
--windowSizestringSet the window size in pixels (WxH), if unset will attempt to maximize window (Non-native studies only)

startStudy Options​

These options are specific to the startStudy command.

OptionTypeDescription
--adHocPublicConfigstringJSON-formatted public config to use for ad-hoc studies. When set, it will completely override the default public config.
--downloadThroughputnumberSet download throughput for emulated network in kBit/s. Set to -1 to disable throttling. (Chrome-based studies only) (default: -1)
--dynamicMetadatastringPath to a file containing dynamic metadata (JSON5-formatted) to be merged with metadata
--enableScreenRecordingbooleanEnable ffmpeg during study with ffmpeg libx264 (default: false)
--enableTcpDumpbooleanEnable tcpdump during study (default: false)
--extraHeadersstring, or objectExtra HTTP headers to send with each request. Can be a JSON object or a JSON-formatted string.
--ffmpegCrfnumberSet CRF for ffmpeg (lower is better quality, higher is better compression) (default: 23)
--ffmpegFpsnumberSet FPS for ffmpeg (will be inferred from display refresh rate if not set)
--ffmpegPresetstringSet preset for ffmpeg (slower is lower file size and higher CPU usage) (default: "medium")
--filterStallingsThresholdnumberThreshold below which stallings will be filtered out in video measurements (in seconds) (default: 0)
--flushDbbooleanFlush the database before starting the study
--flushDbTimeoutnumberTimeout in seconds to wait for flushing the database (default: 10)
--latencynumberSet latency for emulated network in milliseconds (Chrome-based studies only) (default: 0)
--livebooleanRun Measurement in Live mode, i.e. it will not stop at the pre-configured duration but continue forever or until the stream ends on its own (default: false)
--metadatastring, or objectMetadata. Can be a JSON object or a JSON-formatted string.
--mutedbooleanMute browser audio (e.g. during video playback) (default: false)
--noFakeMediaFilesbooleanDo not tell Chrome to use the fake media files as input for testing web conferencing (default: false)
--noFullscreenbooleanDo not start the video studies in fullscreen mode
--noGenerateFakeMediaFilesbooleanDo not generate (or re-generate) the fake media files used for testing web conferencing (default: false)
--notesstringNotes
--reportDirstringSave the report as JSON to the specified directory
--reportFilestringSave the report as JSON to the specified file (will override reportDir if present)
--screenRecordingDirstringSave .mkv file to the specified directory (if not set, will be saved to a temporary directory)
--screenRecordingTargetUrlstringTarget URL for screen recording (if set, will not write to a file)
--sendTimeoutnumberMaximum timeout for sending data in seconds. (default: 15)
--sequentialbooleanRun studies sequentially instead of in parallel
--startOffsetnumber, or arrayOffset the start of the study in seconds. Pass multiple times to offset multiple studies by different amounts (default: 0)
--studyIdstring, or arrayID of the study (as in the public config). Pass multiple times to start multiple studies
--studyTimeoutnumberMaximum study timeout in seconds. This will be increased automatically depending on the individual study timeouts in the public config, if specified. (default: 300)
--tcpDumpDirstringSave .pcap file to the specified directory (if not set, will be saved to a temporary directory)
--uploadThroughputnumberSet upload throughput for emulated network in kBit/s. Set to -1 to disable throttling. (Chrome-based studies only) (default: -1)
--urlstringURL for ad-hoc study (cannot be used with studyId or adHocPublicConfig)
--webRtcDumpDirstringSave WebRTC dump file to the specified directory (if not set, will be saved to the cache directory)
--webRtcDumpFilestringSave WebRTC dump file to the specified file path (will override webRtcDumpDir if present)

register Options​

These options are specific to the register command.

OptionTypeDescription
--labelstringDevice label
--registrationKeystringRegistration key (case-insensitive)
--tagsarrayTags (comma-separated)

loadSchedule Options​

These options are specific to the loadSchedule command.

OptionTypeDescription
--jobTypesarrayType(s) of jobs to load (defaults to all)

setLabel Options​

These options are specific to the setLabel command.

OptionTypeDescription
--labelstringLabel

setTags Options​

These options are specific to the setTags command.

OptionTypeDescription
--tagsarrayTags (comma-separated)