Skip to content

Commit

Permalink
refactor(metrics): remove metrics registry from SQLLite and BlockImpo…
Browse files Browse the repository at this point in the history
…rter tests. PE-4401
  • Loading branch information
dtfiedler committed Aug 29, 2023
1 parent d20e968 commit 0f21bc9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
5 changes: 0 additions & 5 deletions src/database/standalone-sqlite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import arbundles from 'arbundles/stream/index.js';
import { expect } from 'chai';
import crypto from 'node:crypto';
import fs from 'node:fs';
import * as promClient from 'prom-client';

import {
StandaloneSqliteDatabase,
Expand Down Expand Up @@ -160,17 +159,13 @@ describe('SQLite data conversion functions', () => {
});

describe('StandaloneSqliteDatabase', () => {
let metricsRegistry: promClient.Registry;
let chainSource: ArweaveChainSourceStub;
let db: StandaloneSqliteDatabase;
let dbWorker: StandaloneSqliteDatabaseWorker;

before(() => {
metricsRegistry = promClient.register;
metricsRegistry.clear();
db = new StandaloneSqliteDatabase({
log,
metricsRegistry,
coreDbPath,
dataDbPath,
moderationDbPath,
Expand Down
12 changes: 0 additions & 12 deletions src/workers/block-importer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import chai, { expect } from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { EventEmitter } from 'node:events';
import * as promClient from 'prom-client';
import * as sinon from 'sinon';
import sinonChai from 'sinon-chai';
import { default as wait } from 'wait';
Expand All @@ -38,7 +37,6 @@ chai.use(chaiAsPromised);
chai.use(sinonChai);

describe('BlockImporter', () => {
let metricsRegistry: promClient.Registry;
let eventEmitter: EventEmitter;
let blockImporter: BlockImporter;
let chainSource: ArweaveChainSourceStub;
Expand All @@ -54,11 +52,6 @@ describe('BlockImporter', () => {
}) => {
return new BlockImporter({
log,
metricsRegistry,
errorsCounter: new promClient.Counter({
name: 'errors_total',
help: 'Total error count',
}),
chainSource,
chainIndex: db,
eventEmitter,
Expand All @@ -68,13 +61,10 @@ describe('BlockImporter', () => {
};

before(async () => {
metricsRegistry = promClient.register;
metricsRegistry.clear();
eventEmitter = new EventEmitter();
chainSource = new ArweaveChainSourceStub();
db = new StandaloneSqliteDatabase({
log,
metricsRegistry,
bundlesDbPath,
coreDbPath,
dataDbPath,
Expand All @@ -88,8 +78,6 @@ describe('BlockImporter', () => {

beforeEach(async () => {
sandbox = sinon.createSandbox();
metricsRegistry = promClient.register;
metricsRegistry.clear();
});

afterEach(async () => {
Expand Down

0 comments on commit 0f21bc9

Please sign in to comment.