Skip to content

Latest commit

 

History

History
 
 

telemetry-generator

@fluid-tools/telemetry-generator

Internal tool to take JSON files and generate custom telemetry events based on the data in them. Used, for example, to process the output of our performance tests and write relevant metrics to our monitoring systems.

Running the tool

Install dependencies and build the project:

npm i
npm run build

This tool leverages oclif. To run it manually, you need to call oclif's run script in the bin folder, like so:

node bin/run <arguments to the tool>

The start npm script can be used as an alternative to node bin/run, with an extra separator for the arguments, like so:

npm run start -- <arguments to the tool>

The tool has two required arguments:

  • --dir: the path(s) to one or more folders which contain the JSON files to be processed
  • --handlerModule: the absolute path to a JavaScript file that exports a handler function which can process those JSON files. Relative paths are technically supported but you might need a good understanding of Node's module resolution to use them successfully. In short, a relative path will be resolved from the location of the executing file at runtime, and which file that is is not obvious when we're using OCLIF.

Run node bin/run --help for details on the arguments.

Processing the Fluid Framework performance tests

When this tool is used to process our performance tests, the folders should contain files generated by the @fluid-tools/benchmark tool, and the handlers defined here can be used to process them. Make sure to use the correct type of handler (execution time / memory usage) for the output files you want to process. Only one type of file can be processed during a single run of this tool.

Handling custom files

If you want to process your own JSON files with this tool you just need to pass a custom handler to it. See the handler template for details on how that file should look like. Then call the tool as usual, e.g.:

node bin/run --handlerModule /absolute/path/to/your/handler.js --dir /path/to/your/files