Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix last run metric being wrong #207

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Run Homerunner tests
timeout-minutes: 10
env:
HOMERUNNER_IMAGE: ghcr.io/matrix-org/synapse/complement-synapse:latest
HOMERUNNER_IMAGE: ghcr.io/element-hq/synapse/complement-synapse:latest
HOMERUNNER_SPAWN_HS_TIMEOUT_SECS: 100
NODE_OPTIONS: --dns-result-order ipv4first
run: |
Expand Down
6 changes: 3 additions & 3 deletions src/Scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import { Talk } from "./models/Talk";
import { CheckInMap } from "./CheckInMap";
import { ConferenceMatrixClient } from "./ConferenceMatrixClient";
import { IConfig } from "./config";
import { Counter } from "prom-client";
import { Gauge } from "prom-client";

const matrixIdentityApiCallsFailed = new Counter({ name: "confbot_scheduler_last_run", help: "The last time the Scheduler ran its tasks."});
const schedulerLastRunGauge = new Gauge({ name: "confbot_scheduler_last_run", help: "The last time the Scheduler ran its tasks."});

export enum ScheduledTaskType {
TalkStart = "talk_start",
Expand Down Expand Up @@ -196,7 +196,7 @@ export class Scheduler {
private async runTasks() {
try {
const now = (new Date()).getTime();
matrixIdentityApiCallsFailed.inc(now);
schedulerLastRunGauge.set(now);
await this.lock.acquireAsync();
LogService.info("Scheduler", "Scheduling tasks");
try {
Expand Down
Loading