Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
firestore-metrics
Advanced tools
A library which uses the Cloud Monitoring API v3 to view Firestore metrics.
This is a library which uses the Cloud Monitoring API v3 to view Firestore usage metrics.
Viewer
role should suffice.Console
tab.Quick access
> Basic
, pick Viewer
.FirestoreMetrics
import { FirestoreMetrics } from "firestore-metrics";
async function testApi() {
const firestoreMetrics = new FirestoreMetrics({
serviceAccountPath: "./service-account.json",
});
const readUsage = await firestoreMetrics.getReadCount(
"2023-07-22T08:00:00Z",
"2023-07-22T22:42:15Z"
);
console.log(JSON.stringify(readUsage, null, 4));
}
testApi();
Output would look like:
[
{
"type": "QUERY",
"interval": {
"startTime": "2023-08-21T16:15:00Z",
"endTime": "2023-08-21T16:16:00Z"
},
"count": 26
},
{
"type": "QUERY",
"interval": {
"startTime": "2023-08-21T16:14:00Z",
"endTime": "2023-08-21T16:15:00Z"
},
"count": 15
},
{
"type": "QUERY",
"interval": {
"startTime": "2023-08-21T15:51:00Z",
"endTime": "2023-08-21T15:52:00Z"
},
"count": 11
}
]
import { FirestoreMetrics } from "firestore-metrics";
async function testApi() {
const firestoreMetrics = new FirestoreMetrics({
serviceAccountPath: "./service-account.json",
});
const writeUsage = await firestoreMetrics.getWriteCount(
"2023-08-21T15:00:00Z",
"2023-08-21T20:00:00Z"
);
console.log(JSON.stringify(writeUsage, null, 4));
}
testApi();
Output would look like:
[
{
"op": "CREATE",
"interval": {
"startTime": "2023-08-21T16:09:00Z",
"endTime": "2023-08-21T16:10:00Z"
},
"count": 1
},
{
"op": "UPDATE",
"interval": {
"startTime": "2023-08-21T16:15:00Z",
"endTime": "2023-08-21T16:16:00Z"
},
"count": 1
},
{
"op": "UPDATE",
"interval": {
"startTime": "2023-08-21T16:09:00Z",
"endTime": "2023-08-21T16:10:00Z"
},
"count": 1
}
]
Just provide the path to your service-account
file
const firestoreMetrics = new FirestoreMetrics({
serviceAccountPath: "./service-account.json",
});
Just provide the JSON object of your service-account
credentials
const firestoreMetrics = new FirestoreMetrics({
credentials: {
type: "service_account",
project_id: "<PROJECT_ID>",
private_key_id: "<PRIVATE_KEY_ID>",
private_key: "<PRIVATE_KEY>",
client_email: "<CLIENT_EMAIL>",
client_id: "<CLIENT_ID>",
auth_uri: "<AUTH_URI>",
token_uri: "<TOKEN_URI>",
auth_provider_x509_cert_url: "<AUTH_PROVIDER_X509_CERT_URL>",
client_x509_cert_url: "<CLIENT_X509_CERT_URL>",
universe_domain: "<UNIVERSE_DOMAIN>",
},
});
FAQs
A library which uses the Cloud Monitoring API v3 to view Firestore metrics.
The npm package firestore-metrics receives a total of 0 weekly downloads. As such, firestore-metrics popularity was classified as not popular.
We found that firestore-metrics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.