当前位置: 首页>>代码示例>>PHP>>正文


PHP Stats::getStats方法代码示例

本文整理汇总了PHP中Stats::getStats方法的典型用法代码示例。如果您正苦于以下问题:PHP Stats::getStats方法的具体用法?PHP Stats::getStats怎么用?PHP Stats::getStats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stats的用法示例。


在下文中一共展示了Stats::getStats方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 public static function show($id)
 {
     $pokemon = Pokemons::find($id);
     //$joins = Joins::getJoins($id);
     $stats = Stats::getStats($id);
     View::make('Pokemons/:id.html', array('pokemon' => $pokemon, 'stats' => $stats));
 }
开发者ID:Terppa,项目名称:Tsoha-Bootstrap,代码行数:7,代码来源:pokemon_controller.php

示例2: sscanf

foreach ($files as $file) {
    if (strpos($file, "snapshot") !== false) {
        // fnt is YYYY.mm.dd.HH.ii.ss
        sscanf($file, "snapshot-%d.%d.%d.%d.%d.%d", $y, $m, $d, $h, $i, $s);
        $time = mktime($h, $i, $s, $m, $d, $y);
        if ($time > $ts || $ts == 0) {
            $newfiles[] = $file;
        }
    }
}
print "finding files took: " . (microtime(true) - $start) . " secs\n";
$start = microtime(true);
// count the number of snapshots
$c = count($newfiles);
// get data we are interested in from each snapshot (quarantined/fast/ssl/good)
$bad = $stats->getStats(Stats::BAD);
$fast = $stats->getStats(Stats::FAST);
$ssl = $stats->getStats(Stats::SSL);
$good = $stats->getStats(Stats::GOOD);
//$xAxis = array();
$files = $stats->getDates(X_AXIS_FORMAT);
print "fetching stats took: " . (microtime(true) - $start) . " secs\n";
$start = microtime(true);
for ($j = 0; $j < $c; $j++) {
    $file = PF_DIR . "/" . $newfiles[$j];
    sscanf($newfiles[$j], "snapshot-%d.%d.%d.%d.%d.%d", $y, $m, $d, $h, $i, $s);
    $date = sprintf("%d.%02d.%02d.%02d.%02d.%02d", $y, $m, $d, $h, $i, $s);
    print "date: {$date}\n";
    $db = new DatabaseImpl($file);
    $count = count($db->searchEntries(SEARCH_FIELD_OFFSET | SEARCH_ARRAY, 8, 1));
    $stats->addStats($date, Stats::BAD, $count);
开发者ID:TheProjecter,项目名称:miscellaneousrepo,代码行数:31,代码来源:job.php

示例3: die

<?php

/**
 * Stats Example
 * @author Michael Wright	@MichaelW90
 */
// Stats class include
if (!(include_once './Stats.class.php')) {
    die('Error including Stats.class.php');
}
// Instantiate instance of class
$stats = new Stats();
// Store the stats!
foreach ($stats->getStats() as $key => $item) {
    echo '<strong>' . ucwords($key) . ':</strong> ';
    if (is_array($item)) {
        echo '<br />';
        ksort($item);
        foreach ($item as $subkey => $subitem) {
            echo '<strong>- ' . $subkey . ':</strong> ' . $subitem . '<br />';
        }
    } else {
        echo $item . '<br />';
    }
}
开发者ID:JPKCom,项目名称:Basehold.it,代码行数:25,代码来源:getStats.php

示例4: started

        Event::on('query.started', array($this, 'started'));
        Event::on('query.completed', array($this, 'completed'));
    }
    /** Called when a query has started. */
    public function started($query, $arguments)
    {
        $this->active = array('query' => $query, 'arguments' => $arguments, 'start' => microtime(true));
    }
    /** Called when a query has completed. */
    public function completed($query)
    {
        $active = $this->active;
        $active['end'] = microtime(true);
        $active['duration'] = $active['end'] - $active['start'];
        $this->stats[] = $active;
        $this->active = null;
    }
    /** Returns the collected statistics. */
    public function getStats()
    {
        return $this->stats;
    }
}
$stats = new Stats();
$stats->register();
// Execute some queries
Person::find(10);
Person::objects()->fetch();
// Print collected statistics
print_r($stats->getStats());
开发者ID:Macavity,项目名称:phormium,代码行数:30,代码来源:events.php


注:本文中的Stats::getStats方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。