Merge branch 'master' into mainnet-beta
This commit is contained in:
@@ -82,6 +82,10 @@ const oracleSlotGauge = metricsV2.addGauge(
|
||||
'oracle_slot',
|
||||
'Last updated slot of oracle'
|
||||
);
|
||||
const marketSlotGauge = metricsV2.addGauge(
|
||||
'market_slot',
|
||||
'Last updated slot of market account'
|
||||
);
|
||||
const kinesisRecordsSentCounter = metricsV2.addCounter(
|
||||
'kinesis_records_sent',
|
||||
'Number of records sent to Kinesis'
|
||||
@@ -563,6 +567,10 @@ const main = async () => {
|
||||
const oracleDataAndSlot = driftClient.getOracleDataForPerpMarket(
|
||||
market.marketIndex
|
||||
);
|
||||
const marketAccount =
|
||||
driftClient.accountSubscriber.getMarketAccountAndSlot(
|
||||
market.marketIndex
|
||||
);
|
||||
dlobSlotGauge.setLatestValue(slot, {
|
||||
marketIndex: market.marketIndex,
|
||||
marketType: 'perp',
|
||||
@@ -577,11 +585,22 @@ const main = async () => {
|
||||
redisClient: REDIS_CLIENT,
|
||||
redisPrefix: RedisClientPrefix[REDIS_CLIENT],
|
||||
});
|
||||
marketSlotGauge.setLatestValue(marketAccount.slot, {
|
||||
marketIndex: market.marketIndex,
|
||||
marketType: 'perp',
|
||||
marketName: market.marketName,
|
||||
redisClient: REDIS_CLIENT,
|
||||
redisPrefix: RedisClientPrefix[REDIS_CLIENT],
|
||||
});
|
||||
});
|
||||
spotMarketInfos.forEach((market) => {
|
||||
const oracleDataAndSlot = driftClient.getOracleDataForSpotMarket(
|
||||
market.marketIndex
|
||||
);
|
||||
const marketAccount =
|
||||
driftClient.accountSubscriber.getSpotMarketAccountAndSlot(
|
||||
market.marketIndex
|
||||
);
|
||||
dlobSlotGauge.setLatestValue(slot, {
|
||||
marketIndex: market.marketIndex,
|
||||
marketType: 'spot',
|
||||
@@ -596,6 +615,13 @@ const main = async () => {
|
||||
redisClient: REDIS_CLIENT,
|
||||
redisPrefix: RedisClientPrefix[REDIS_CLIENT],
|
||||
});
|
||||
marketSlotGauge.setLatestValue(marketAccount.slot, {
|
||||
marketIndex: market.marketIndex,
|
||||
marketType: 'spot',
|
||||
marketName: market.marketName,
|
||||
redisClient: REDIS_CLIENT,
|
||||
redisPrefix: RedisClientPrefix[REDIS_CLIENT],
|
||||
});
|
||||
});
|
||||
}, 10_000);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user