https://github.com/metrics-pli/bigquery-export
Exports collected metrics to Google Big Query
https://github.com/metrics-pli/bigquery-export
bigquery datastudio lighthouse metrics metrics-pli performance pupeteer
Last synced: 30 days ago
JSON representation
Exports collected metrics to Google Big Query
- Host: GitHub
- URL: https://github.com/metrics-pli/bigquery-export
- Owner: metrics-pli
- License: mit
- Created: 2018-05-14T15:35:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-18T14:05:08.000Z (about 8 years ago)
- Last Synced: 2025-03-18T04:57:45.388Z (about 1 year ago)
- Topics: bigquery, datastudio, lighthouse, metrics, metrics-pli, performance, pupeteer
- Language: TypeScript
- Size: 25.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bigquery-export
Exports collected metrics to Google Big Query
Can be hooked up very easily to a metricsPli instance.
You can debug logs via `DEBUG=mpli:bqexport`.
The bigquery config fields accepts all parameters that you can pass to
`@google-cloud/bigquery`.
```javascript
import MetricsPli, { ConfigInterface, TestInterface } from "@metrics-pli/core";
import Exporter from "@metrics-pli/exporter-bigquery";
const keyFilename = "/Users/jondoe/Documents/jons-plat-123.json";
const exporterConfig = {
bigquery: {
projectId: "123123123",
keyFilename,
},
dataset: "my_metrics_dataset",
table: "my_metrics_table",
batchSize: 75,
batchTimeout: 60 * 1000,
};
const tests: TestInterface[] = [{
name: "Homepage",
url: "https://google.com/",
}];
const config: ConfigInterface = {};
(async () => {
const metricsPli = new MetricsPli(tests, config);
const bqExporter = new Exporter(exporterConfig);
await bqExporter.init();
bqExporter.registerWith(metricsPli);
// will also emit exporter error events
metricsPli.on("error", console.error);
metricsPli.on("info", console.info);
await metricsPli.run();
await bqExporter.close();
})();
```