Esempio n. 1
0
    def findStaticsByTimestampAndCounter_name(timestamp,counter_name,page,rows):
        if not MongoEngineUtil.ceilo_collection:
            MongoEngineUtil.__init_mongo_connector()

        modelList=Statistics86400.objects(timestamp__gte=timestamp,counter_name=counter_name)[page:rows]\
            .order_by('-avg,-timestamp');
        return modelList
Esempio n. 2
0
    def findStaticsCountByTimestampAndCounter_name(timestamp, counter_name):
        if not MongoEngineUtil.ceilo_collection:
            MongoEngineUtil.__init_mongo_connector()

        count = Statistics86400.objects(timestamp__gte=timestamp,
                                        counter_name=counter_name).count()
        return count
Esempio n. 3
0
    def findStaticsByTimestampAndCounter_name(timestamp, counter_name, page,
                                              rows):
        if not MongoEngineUtil.ceilo_collection:
            MongoEngineUtil.__init_mongo_connector()

        modelList=Statistics86400.objects(timestamp__gte=timestamp,counter_name=counter_name)[page:rows]\
            .order_by('-avg,-timestamp')
        return modelList
Esempio n. 4
0
    def findLimitStaticsByTimestampAndCounter_name(bdt,edt,counter_name,limit,order,sortby):
        if not MongoEngineUtil.ceilo_collection:
            MongoEngineUtil.__init_mongo_connector()

        if order=='aesc':
            order_by=sortby
        elif order=='desc':
            order_by='-'+sortby

        print(order_by)
        modelList=Statistics86400.objects(timestamp__gte=bdt,timestamp__lte=edt,counter_name=counter_name)[:limit]\
                .order_by(order_by);
        return modelList
Esempio n. 5
0
    def findLimitStaticsByTimestampAndCounter_name(bdt, edt, counter_name,
                                                   limit, order, sortby):
        if not MongoEngineUtil.ceilo_collection:
            MongoEngineUtil.__init_mongo_connector()

        if order == 'aesc':
            order_by = sortby
        elif order == 'desc':
            order_by = '-' + sortby

        print(order_by)
        modelList=Statistics86400.objects(timestamp__gte=bdt,timestamp__lte=edt,counter_name=counter_name)[:limit]\
                .order_by(order_by)
        return modelList
Esempio n. 6
0
    def findStaticsCountByTimestampAndCounter_name(timestamp,counter_name):
        if not MongoEngineUtil.ceilo_collection:
            MongoEngineUtil.__init_mongo_connector()

        count=Statistics86400.objects(timestamp__gte=timestamp,counter_name=counter_name).count();
        return count