- Add full Telegram bot functionality with Z.AI API integration
- Implement 4 tools: Bash, FileEdit, WebSearch, Git
- Add 3 agents: Code Reviewer, Architect, DevOps Engineer
- Add 6 skills for common coding tasks
- Add systemd service file for 24/7 operation
- Add nginx configuration for HTTPS webhook
- Add comprehensive documentation
- Implement WebSocket server for real-time updates
- Add logging system with Winston
- Add environment validation
🤖 zCode CLI X - Agentic coder with Z.AI + Telegram integration
85 lines
3.7 KiB
JavaScript
85 lines
3.7 KiB
JavaScript
/*
|
|
* Copyright The OpenTelemetry Authors
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
import { createInstrumentDescriptor } from './InstrumentDescriptor';
|
|
import { CounterInstrument, GaugeInstrument, HistogramInstrument, ObservableCounterInstrument, ObservableGaugeInstrument, ObservableUpDownCounterInstrument, UpDownCounterInstrument, } from './Instruments';
|
|
import { InstrumentType } from './export/MetricData';
|
|
/**
|
|
* This class implements the {@link IMeter} interface.
|
|
*/
|
|
export class Meter {
|
|
_meterSharedState;
|
|
constructor(meterSharedState) {
|
|
this._meterSharedState = meterSharedState;
|
|
}
|
|
/**
|
|
* Create a {@link Gauge} instrument.
|
|
*/
|
|
createGauge(name, options) {
|
|
const descriptor = createInstrumentDescriptor(name, InstrumentType.GAUGE, options);
|
|
const storage = this._meterSharedState.registerMetricStorage(descriptor);
|
|
return new GaugeInstrument(storage, descriptor);
|
|
}
|
|
/**
|
|
* Create a {@link Histogram} instrument.
|
|
*/
|
|
createHistogram(name, options) {
|
|
const descriptor = createInstrumentDescriptor(name, InstrumentType.HISTOGRAM, options);
|
|
const storage = this._meterSharedState.registerMetricStorage(descriptor);
|
|
return new HistogramInstrument(storage, descriptor);
|
|
}
|
|
/**
|
|
* Create a {@link Counter} instrument.
|
|
*/
|
|
createCounter(name, options) {
|
|
const descriptor = createInstrumentDescriptor(name, InstrumentType.COUNTER, options);
|
|
const storage = this._meterSharedState.registerMetricStorage(descriptor);
|
|
return new CounterInstrument(storage, descriptor);
|
|
}
|
|
/**
|
|
* Create a {@link UpDownCounter} instrument.
|
|
*/
|
|
createUpDownCounter(name, options) {
|
|
const descriptor = createInstrumentDescriptor(name, InstrumentType.UP_DOWN_COUNTER, options);
|
|
const storage = this._meterSharedState.registerMetricStorage(descriptor);
|
|
return new UpDownCounterInstrument(storage, descriptor);
|
|
}
|
|
/**
|
|
* Create a {@link ObservableGauge} instrument.
|
|
*/
|
|
createObservableGauge(name, options) {
|
|
const descriptor = createInstrumentDescriptor(name, InstrumentType.OBSERVABLE_GAUGE, options);
|
|
const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor);
|
|
return new ObservableGaugeInstrument(descriptor, storages, this._meterSharedState.observableRegistry);
|
|
}
|
|
/**
|
|
* Create a {@link ObservableCounter} instrument.
|
|
*/
|
|
createObservableCounter(name, options) {
|
|
const descriptor = createInstrumentDescriptor(name, InstrumentType.OBSERVABLE_COUNTER, options);
|
|
const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor);
|
|
return new ObservableCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry);
|
|
}
|
|
/**
|
|
* Create a {@link ObservableUpDownCounter} instrument.
|
|
*/
|
|
createObservableUpDownCounter(name, options) {
|
|
const descriptor = createInstrumentDescriptor(name, InstrumentType.OBSERVABLE_UP_DOWN_COUNTER, options);
|
|
const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor);
|
|
return new ObservableUpDownCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry);
|
|
}
|
|
/**
|
|
* @see {@link Meter.addBatchObservableCallback}
|
|
*/
|
|
addBatchObservableCallback(callback, observables) {
|
|
this._meterSharedState.observableRegistry.addBatchCallback(callback, observables);
|
|
}
|
|
/**
|
|
* @see {@link Meter.removeBatchObservableCallback}
|
|
*/
|
|
removeBatchObservableCallback(callback, observables) {
|
|
this._meterSharedState.observableRegistry.removeBatchCallback(callback, observables);
|
|
}
|
|
}
|
|
//# sourceMappingURL=Meter.js.map
|