Skip to content

Commit

Permalink
Merge pull request #71 from w3f/liveness-test
Browse files Browse the repository at this point in the history
Liveness test
  • Loading branch information
ironoa authored Nov 17, 2021
2 parents d5e3c8a + 698bb75 commit 4a90da6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/polkadot-watcher/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Polkadot Watcher
name: polkadot-watcher
version: v3.0.12
version: v3.1.0
apiVersion: v2
2 changes: 1 addition & 1 deletion charts/polkadot-watcher/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ port: 3000

image:
repo: web3f/polkadot-watcher
tag: v3.0.12
tag: v3.1.0

config:
endpoint: "wss://kusama-rpc.polkadot.io"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polkadot-watcher",
"version": "3.0.12",
"version": "3.1.0",
"description": "Monitor events on Polkadot networks",
"repository": "git@github.com:w3f/polkadot-watcher.git",
"author": "W3F Infrastructure Team <devops@web3.foundation>",
Expand Down
8 changes: 8 additions & 0 deletions src/subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export class Subscriber {

await this._handleNewHeadSubscriptions();
await this._subscribeEvents();

this._initMetricsLivenessTest();
}

private async _initAPI(): Promise<void> {
Expand Down Expand Up @@ -234,6 +236,12 @@ export class Subscriber {
});
}

private _initMetricsLivenessTest(): void {
const testAccountName = "LIVENESS_TEST_NO_ACTION_REQUIRED"
this.promClient.increaseTotalValidatorOfflineReports(testAccountName,testAccountName);
setTimeout(()=>{this.promClient.resetTotalValidatorOfflineReports(testAccountName);},60000)
}

private _initOutOfActiveSetMetrics(): void {
this.validators.forEach((account) => {
// always increase metric even the first time, so that we initialize the time serie
Expand Down

0 comments on commit 4a90da6

Please sign in to comment.