function apachesolr_stats_get_granularities in Apache Solr Statistics 6.3
Same name and namespace in other branches
- 6 apachesolr_stats.module \apachesolr_stats_get_granularities()
- 7 apachesolr_stats.module \apachesolr_stats_get_granularities()
Returns an array of preset granularities.
Return value
array an array of preset granularities for reports.
1 call to apachesolr_stats_get_granularities()
- apachesolr_stats_report in ./apachesolr_stats.module 
- Callback for admin/reports/apachesolr/stats.
File
- ./apachesolr_stats.module, line 578 
- Keeps and reports statistics about Apache Solr usage and performance.
Code
function apachesolr_stats_get_granularities() {
  $granularities = array(
    'minute' => array(
      'name' => t('minute'),
      'timespan' => 60,
      'time_before' => 60 * 60 * 24,
      // One day before
      'last_msg' => t('last day'),
      'format' => '%H:%M',
    ),
    'hour' => array(
      'name' => t('hour'),
      'timespan' => 60 * 60,
      'time_before' => 60 * 60 * 24 * 7,
      // One week before
      'last_msg' => t('last week'),
      'format' => '%m/%d %H:%M',
    ),
    'day' => array(
      'name' => t('day'),
      'timespan' => 60 * 60 * 24,
      'time_before' => 60 * 60 * 24 * 2 * 16,
      // 4 weeks before
      'last_msg' => t('last month'),
      'format' => '%m/%d',
    ),
    'all' => array(
      'name' => t('day'),
      'timespan' => 60 * 60 * 24,
      'time_before' => 60 * 60 * 24 * 7 * 16,
      // 16 weeks before
      'last_msg' => t('all time (depends on settings)'),
      'format' => '%m/%d',
    ),
  );
  return $granularities;
}