simple-prom/test/testServer.ts

24 lines
No EOL
801 B
TypeScript

// Copyright (c) Catgirl Enterprises - Licensed under MIT
// Check LICENSE in repository root for more information.
import SimpleProm from "../index";
import Counter from "../objects/Counter";
import Gauge from "../objects/Gauge";
const instance = SimpleProm.init({
selfHost: true
});
const testGaugeNoHelp = instance.addMetric(new Gauge("test_gauge_no_help"));
testGaugeNoHelp.Value = 1337;
const testGaugeHelp = instance.addMetric(new Gauge("test_gauge"));
testGaugeHelp.setHelpText("Test gauge help");
testGaugeHelp.Value = 1337;
const testCounterNoHelp = instance.addMetric(new Counter("test_counter_no_help"));
testCounterNoHelp.add(1337);
const testCounterHelp = instance.addMetric(new Counter("test_counter"));
testCounterHelp.setHelpText("Test counter help");
testCounterHelp.add(1337);