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
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
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
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
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
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