An open API service indexing awesome lists of open source software.

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

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();
})();
```