예제 #1
0
def noise_stat_last_updated(domain, now=None):
    """Get the last-updated date for the statistics for a domain."""
    if now is None:
        now = datetime.datetime.now()

    value = db.get('noise_statistic_updated', domain)
    if value is None:
        return

    return datetime.datetime.strptime(value, db.datetime_format)
예제 #2
0
def noise_stat_last_updated(domain, now=None):
    """Get the last-updated date for the statistics for a domain."""
    if now is None:
        now = datetime.datetime.now()

    value = db.get('noise_statistic_updated', domain)
    if value is None:
        return

    return db.from_db_datetime(value)
예제 #3
0
def get_noise_stat(domain):
    """Get the noise statistics for a domain."""
    stat = db.get('noise_statistic', domain)
    if stat is None:
        return

    return NoiseStatistic(
        domain,
        stat['deltas'],
        datetime.datetime.strptime(stat['window_start']),
        stat['noisy'],
    )
예제 #4
0
def get_noise_stat(domain):
    """Get the noise statistics for a domain."""
    stat = db.get('noise_statistic', domain)
    if stat is None:
        return

    return NoiseStatistic(
        domain,
        stat['deltas'],
        db.from_db_datetime(stat['window_start']),
        stat['noisy'],
    )