-
Notifications
You must be signed in to change notification settings - Fork 258
test(NODE-6756): add tags to benchmarks #751
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
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
d5cb09c
update bsonBench
W-A-James 5a9635b
add tags to granular benchmarks
W-A-James e836325
add tags to granular and spec tests
W-A-James ae6750a
update lockfile
W-A-James ca24538
lint and update lockfile
W-A-James 54730a6
add normalized measurements to custom benchmarks
W-A-James e3a8def
update tag setting for granular tests
W-A-James 4fba4e3
accomodate cpu baseline in custom benchmarks
W-A-James ca6bb42
support cpu baseline in granular and spec benchmarks
W-A-James a29eebb
update readme
W-A-James 57e77f1
update gitignore
W-A-James a1ba3cc
fix error
W-A-James c22023d
change test name
W-A-James 5ed4b71
small fixes
W-A-James 90bca22
address review comments
W-A-James 86b9cff
Use latest dbx-js-tools
W-A-James 3703f72
use new perfSend
W-A-James fd50317
add new script
W-A-James 67e0739
update ci config
W-A-James 5e01f0e
Update .evergreen/perf_send.mjs
W-A-James fee984c
convert to async
W-A-James 6c75090
use .text instead of .json
W-A-James 9020210
fully print out request body
W-A-James 433542b
fix perf_send
W-A-James c1d58ee
wip
W-A-James fbd7337
chore: try new url
nbbeeken 12ed9c8
fix script response parsing
nbbeeken ca5a1be
move time stamps
nbbeeken 038ad89
chore: small fixes
nbbeeken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh | ||
set -o xtrace | ||
TARGET_FILE=$TARGET_FILE | ||
|
||
node ./.evergreen/perf_send.mjs $TARGET_FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import fs from 'fs/promises'; | ||
import util from 'util'; | ||
|
||
const API_PATH = 'https://performance-monitoring-api.corp.mongodb.com/raw_perf_results'; | ||
|
||
const resultFile = process.argv[2]; | ||
if (resultFile == null) { | ||
throw new Error('Must specify result file'); | ||
} | ||
|
||
// Get expansions | ||
const { | ||
execution, | ||
requester, | ||
project, | ||
task_id, | ||
task_name, | ||
revision_order_id, | ||
build_variant: variant, | ||
version_id: version | ||
} = process.env; | ||
|
||
const orderSplit = revision_order_id?.split('_'); | ||
const order = Number(orderSplit ? orderSplit[orderSplit.length - 1] : undefined); | ||
|
||
if (!Number.isInteger(order)) throw new Error(`Failed to parse integer from order, revision_order_id=${revision_order_id}`); | ||
|
||
const results = JSON.parse(await fs.readFile(resultFile, 'utf8')); | ||
|
||
// FIXME(NODE-6838): We are using dummy dates here just to be able to successfully post our results | ||
for (const r of results) { | ||
r.created_at = new Date().toISOString(); | ||
r.completed_at = new Date().toISOString(); | ||
} | ||
|
||
const body = { | ||
id: { | ||
project, | ||
version, | ||
variant, | ||
order, | ||
task_name, | ||
task_id, | ||
execution, | ||
mainline: requester === 'commit' | ||
}, | ||
results | ||
}; | ||
|
||
console.log('POST', util.inspect(body, { depth: Infinity })); | ||
|
||
const resp = await fetch(API_PATH, { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
accept: 'application/json' | ||
}, | ||
body: JSON.stringify(body) | ||
}); | ||
|
||
const responseText = await resp.text(); | ||
let jsonResponse = null; | ||
try { | ||
jsonResponse = JSON.parse(responseText) | ||
} catch (cause) { | ||
console.log('Failed to parse json response', cause); | ||
} | ||
|
||
console.log(resp.statusText, util.inspect(jsonResponse ?? responseText, { depth: Infinity })); | ||
|
||
if (jsonResponse.message == null) throw new Error("Didn't get success message"); | ||
|
||
console.log(jsonResponse.message); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
/* eslint-disable strict */ | ||
import { BSON } from '../../../lib/bson.mjs'; | ||
|
||
const ObjectId_isValid = [ | ||
function objectid_isvalid_wrong_string_length() { | ||
BSON.ObjectId.isValid('a'); | ||
}, | ||
/** wrong character at the start, could be the most short circuited code path */ | ||
function objectid_isvalid_invalid_hex_at_start() { | ||
BSON.ObjectId.isValid('g6e84ebdc96f4c0772f0cbbf'); | ||
}, | ||
/** wrong character at the end, could be the least short circuited code path */ | ||
function objectid_isvalid_invalid_hex_at_end() { | ||
BSON.ObjectId.isValid('66e84ebdc96f4c0772f0cbbg'); | ||
}, | ||
function objectid_isvalid_valid_hex_string() { | ||
BSON.ObjectId.isValid('66e84ebdc96f4c0772f0cbbf'); | ||
} | ||
]; | ||
const ObjectId_isValid = { | ||
name: 'ObjectId_isValid', | ||
tags: ['alerting-benchmark', 'objectid'], | ||
benchmarks: [ | ||
function objectid_isvalid_wrong_string_length() { | ||
BSON.ObjectId.isValid('a'); | ||
}, | ||
/** wrong character at the start, could be the most short circuited code path */ | ||
function objectid_isvalid_invalid_hex_at_start() { | ||
BSON.ObjectId.isValid('g6e84ebdc96f4c0772f0cbbf'); | ||
}, | ||
/** wrong character at the end, could be the least short circuited code path */ | ||
function objectid_isvalid_invalid_hex_at_end() { | ||
BSON.ObjectId.isValid('66e84ebdc96f4c0772f0cbbg'); | ||
}, | ||
function objectid_isvalid_valid_hex_string() { | ||
BSON.ObjectId.isValid('66e84ebdc96f4c0772f0cbbf'); | ||
} | ||
] | ||
}; | ||
nbbeeken marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Add benchmarks here: | ||
export const benchmarks = [...ObjectId_isValid]; | ||
export const suites = [ObjectId_isValid]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*Results.json | ||
resultsCollected.json | ||
cpuBaseline.json | ||
resultsCollected*.json |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.