Ejemplo n.º 1
0
        public StatisticsDto GetStatistics()
        {
            StatisticsDto resultStats = new StatisticsDto();

            IMemcachedClient client = this.GetMemcachedClient();

            ServerStats stats = client.Stats();

            return(resultStats);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取缓存数量
        /// </summary>
        /// <param name="prefix">缓存键前缀</param>
        /// <returns></returns>
        public int GetCount(string prefix = "")
        {
            if (string.IsNullOrWhiteSpace(prefix))
            {
                // 不准确,有时Memecached只会使缓存过期但不会立即释放或刷新内存
                return(int.Parse(_memcachedClient.Stats().GetRaw("curr_items").FirstOrDefault().Value));
            }

            return(0);
        }
Ejemplo n.º 3
0
        public SlabStatisticsDto GetMetadata()
        {
            SlabStatisticsDto resultMetadata = new SlabStatisticsDto();

            IMemcachedClient client = this.GetMemcachedClient();

            ServerStats stats = client.Stats();

            return(resultMetadata);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets the count.
 /// </summary>
 /// <returns>The count.</returns>
 /// <param name="prefix">Prefix.</param>
 public int GetCount(string prefix = "")
 {
     if (string.IsNullOrWhiteSpace(prefix))
     {
         //Inaccurate, sometimes, memcached just causes items to expire but not free up or flush memory at once.
         return(int.Parse(_memcachedClient.Stats().GetRaw("curr_items").FirstOrDefault().Value));
     }
     else
     {
         return(0);
     }
 }
Ejemplo n.º 5
0
 public ServerStats Stats()
 {
     return(_memcachedClient.Stats());
 }