Merge pull request #792 from shocknet/latest-limit

default latest limit
This commit is contained in:
Justin (shocknet) 2025-02-25 12:51:25 -05:00 committed by GitHub
commit 1e1a05b232
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View file

@ -25,8 +25,6 @@ export default class {
process.on('exit', () => { process.on('exit', () => {
this.persistCache() this.persistCache()
}); });
} }
getlast24hCache = () => { return this.last24hCache } getlast24hCache = () => { return this.last24hCache }
@ -78,7 +76,7 @@ export default class {
} }
LoadLatestMetrics = async (limit = 100): Promise<Types.UsageMetrics> => { LoadLatestMetrics = async (limit = 30): Promise<Types.UsageMetrics> => {
const raw = this.tlvStorage.LoadLatest(limit) const raw = this.tlvStorage.LoadLatest(limit)
const metrics: Types.UsageMetrics = { apps: {} } const metrics: Types.UsageMetrics = { apps: {} }
Object.keys(raw).forEach(app => { Object.keys(raw).forEach(app => {

View file

@ -46,7 +46,7 @@ export class TlvFilesStorage {
this.pending[appId][dataName].tlvs.push(tlv) this.pending[appId][dataName].tlvs.push(tlv)
} }
LoadLatest = (limit = 100): LatestData => { LoadLatest = (limit = 30): LatestData => {
this.persist() this.persist()
const data: LatestData = {} const data: LatestData = {}
this.foreachFile((app, dataName, tlvFiles) => { this.foreachFile((app, dataName, tlvFiles) => {