<?php

namespace Api\PhpServices\XhProfiler;

use Api\PhpUtils\Mongo\MongoBase;

class XhMongo extends MongoBase
{
    protected function getConfigIndex()
    {
        return 'xhprof';
    }

    protected function getDatabaseName()
    {
        return 'xhprof';
    }

    protected function getCollectionName()
    {
        $sever = str_replace('.','_',$_SERVER['SERVER_NAME']);
        $collection = \Yaconf::get('xhprof.common.collection');
        if (isset($collection[$sever])) {
            return $sever;
        }

        // 默认使用results
        return 'results';
    }
}