mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-25 00:58:45 +05:00
LcgProfiles added in cache stats
This commit is contained in:
@@ -915,6 +915,7 @@ func (self *ApierV1) GetCacheStats(attrs utils.AttrCacheStats, reply *utils.Cach
|
||||
cs.RatingAliases = cache2go.CountEntries(engine.RP_ALIAS_PREFIX)
|
||||
cs.AccountAliases = cache2go.CountEntries(engine.ACC_ALIAS_PREFIX)
|
||||
cs.DerivedChargers = cache2go.CountEntries(engine.DERIVEDCHARGERS_PREFIX)
|
||||
cs.LcrProfiles = cache2go.CountEntries(engine.LCR_PREFIX)
|
||||
*reply = *cs
|
||||
return nil
|
||||
}
|
||||
@@ -926,7 +927,8 @@ func (self *ApierV1) GetCachedItemAge(itemId string, reply *utils.CachedItemAge)
|
||||
cachedItemAge := new(utils.CachedItemAge)
|
||||
var found bool
|
||||
for idx, cacheKey := range []string{engine.DESTINATION_PREFIX + itemId, engine.RATING_PLAN_PREFIX + itemId, engine.RATING_PROFILE_PREFIX + itemId,
|
||||
engine.ACTION_PREFIX + itemId, engine.SHARED_GROUP_PREFIX + itemId, engine.RP_ALIAS_PREFIX + itemId, engine.ACC_ALIAS_PREFIX + itemId} {
|
||||
engine.ACTION_PREFIX + itemId, engine.SHARED_GROUP_PREFIX + itemId, engine.RP_ALIAS_PREFIX + itemId, engine.ACC_ALIAS_PREFIX + itemId,
|
||||
engine.LCR_PREFIX + itemId} {
|
||||
if age, err := cache2go.GetKeyAge(cacheKey); err == nil {
|
||||
found = true
|
||||
switch idx {
|
||||
@@ -944,6 +946,8 @@ func (self *ApierV1) GetCachedItemAge(itemId string, reply *utils.CachedItemAge)
|
||||
cachedItemAge.RatingAlias = age
|
||||
case 6:
|
||||
cachedItemAge.AccountAlias = age
|
||||
case 7:
|
||||
cachedItemAge.LcrProfiles = age
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -634,6 +634,7 @@ type ApiReloadCache struct {
|
||||
AccAliases []string
|
||||
LCRIds []string
|
||||
DerivedChargers []string
|
||||
LcrProfiles []string
|
||||
}
|
||||
|
||||
type AttrCacheStats struct { // Add in the future filters here maybe so we avoid counting complete cache
|
||||
@@ -648,6 +649,7 @@ type CacheStats struct {
|
||||
RatingAliases int
|
||||
AccountAliases int
|
||||
DerivedChargers int
|
||||
LcrProfiles int
|
||||
}
|
||||
|
||||
type AttrCachedItemAge struct {
|
||||
@@ -664,6 +666,7 @@ type CachedItemAge struct {
|
||||
RatingAlias time.Duration
|
||||
AccountAlias time.Duration
|
||||
DerivedChargers time.Duration
|
||||
LcrProfiles time.Duration
|
||||
}
|
||||
|
||||
type AttrExpFileCdrs struct {
|
||||
|
||||
Reference in New Issue
Block a user