Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timestamp to the JSON output #67

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cli.js
Expand Up @@ -146,6 +146,7 @@ st.once('uploadspeed', speed => {

st.on('data', data => {
if (cli.flags.verbose) {
stats.timestamp = new Date().getTime();
stats.data = data;
}

Expand Down
9 changes: 9 additions & 0 deletions readme.md
Expand Up @@ -28,6 +28,15 @@ $ speed-test --help
--verbose -v Output more detailed information
```

## Tips

### Batch monitoring

```bash
while true; do sleep 30; node cli.js --verbose --json; done >> ~/net.log
```

**Note**: using the **"--verbose"** and **"--json"** will include a timestamp **e.g**: "1603971242534" property generated now in form of a timestamp, good for recording the metrics in some monitoring software.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be documented generally. It's not specific to "batch monitoring".

And I think the text should be slightly better written and formatted.


## Links

Expand Down