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