-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bd7f6f
commit 26a4faa
Showing
17 changed files
with
292 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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,23 +1,24 @@ | ||
import "dotenv/config"; | ||
|
||
import { storeInGitHub } from "./github-storage.js"; | ||
import logger from "./logger.js"; | ||
|
||
if (!process.env.REPOSITORY_PATH) { | ||
throw new Error("REPOSITORY_PATH environment variable is not set"); | ||
} | ||
let metrics_path = "/metrics/metrics.json"; | ||
if (!process.env.METRICS_PATH) { | ||
console.warn("Using default METRICS_PATH /metrics/metrics.json") | ||
logger.warn("Using default METRICS_PATH /metrics/metrics.json") | ||
} else { | ||
metrics_path = process.env.METRICS_PATH; | ||
} | ||
console.log(`REPOSITORY_PATH="${process.env.REPOSITORY_PATH}"`); | ||
console.log(`METRICS_PATH="${process.env.METRICS_PATH}"`) | ||
logger.info(`REPOSITORY_PATH="${process.env.REPOSITORY_PATH}"`); | ||
logger.info(`METRICS_PATH="${process.env.METRICS_PATH}"`) | ||
|
||
const benchmark = Boolean(process.env.BENCHMARK); | ||
console.log(`Perform benchmarking of operations`); | ||
if (benchmark) logger.info(`Perform benchmarking of operations`); | ||
|
||
storeInGitHub(metrics_path, benchmark).catch((e) => { | ||
console.error(e); | ||
logger.error(e); | ||
process.exit(1); | ||
}); |
This file contains 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,13 @@ | ||
import { pino } from 'pino'; | ||
|
||
const logger = pino({ | ||
level: process.env.LOG_LEVEL || 'info', | ||
transport: { | ||
target: 'pino-pretty', | ||
options: { | ||
colorize: process.env.NODE_ENV !== 'production' | ||
} | ||
} | ||
}); | ||
|
||
export default logger; |
This file contains 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
Oops, something went wrong.