From 83bab44b3cc7e61f7286807a4065b474d8b49193 Mon Sep 17 00:00:00 2001 From: DanB Date: Sun, 24 May 2015 18:32:46 +0200 Subject: [PATCH] LcgProfiles added in cache stats --- apier/v1/apier.go | 6 +++++- utils/apitpdata.go | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apier/v1/apier.go b/apier/v1/apier.go index 7579a3c45..21699f4db 100644 --- a/apier/v1/apier.go +++ b/apier/v1/apier.go @@ -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 } } } diff --git a/utils/apitpdata.go b/utils/apitpdata.go index 913d3e1f3..6e429a8e8 100644 --- a/utils/apitpdata.go +++ b/utils/apitpdata.go @@ -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 {