~piotr-sikora/libmemcached/connect-fix

« back to all changes in this revision

Viewing changes to libmemcached/analyze.cc

  • Committer: Brian Aker
  • Date: 2011-06-18 03:50:54 UTC
  • mfrom: (929.1.148 libmemcached-build)
  • Revision ID: brian@tangent.org-20110618035054-qyuahv16cx83kyef
Merge Trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    return;
56
56
  }
57
57
 
58
 
  double temp= (double) (total_get_hits/total_get_cmds);
 
58
  double temp= double(total_get_hits) / total_get_cmds;
59
59
  result->pool_hit_ratio= temp * 100;
60
60
}
61
61
 
68
68
  uint32_t server_count, x;
69
69
  memcached_analysis_st *result;
70
70
 
 
71
  if (not memc or not memc_stat)
 
72
    return NULL;
 
73
 
71
74
  *error= MEMCACHED_SUCCESS;
72
75
  server_count= memcached_server_count(memc);
73
76
  result= (memcached_analysis_st*)calloc(memcached_server_count(memc),
74
77
                                         sizeof(memcached_analysis_st));
75
78
 
76
 
  if (!result)
 
79
  if (not result)
77
80
  {
78
81
    *error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
79
82
    return NULL;