def aggregate(self, start, end):
        '''
        This method encpsualte the metric aggregation logic.
        Override this method when you inherit this class.
        By default, it takes the last value.
        '''
        last = self.objects(
            level='daily', date__lte=self.iso(end),
            date__gte=self.iso(start)).order_by('-date').first()
        return last.values[self.name]
def aggregate ( self , start , end ) : last = self . objects ( level = 'daily' , date__lte = self . iso ( end ) , date__gte = self . iso ( start ) ) . order_by ( '-date' ) . first ( ) return last . values [ self . name ]
This method encpsualte the metric aggregation logic.
        Override this method when you inherit this class.
        By default, it takes the last value.