Exemplo n.º 1
0
def mark_noise_stat_as_updated(domain, now=None):
    """Mark a set of statistics for a domain as updated."""
    if now is None:
        now = datetime.datetime.now()

    value = now.strftime(db.datetime_format)
    db.set('noise_statistic_updated', domain, value)
Exemplo n.º 2
0
def mark_noise_stat_as_updated(domain, now=None):
    """Mark a set of statistics for a domain as updated."""
    if now is None:
        now = datetime.datetime.now()

    value = db.to_db_datetime(now)
    db.set('noise_statistic_updated', domain, value)
Exemplo n.º 3
0
def set_noise_stat(stat):
    """Update the noise statistics for a domain."""
    value = {
        'deltas': stat.deltas,
        'window_start': stat.window_start.strftime(db.datetime_format),
        'noisy': stat.is_noisy,
    }
    db.set('noise_statistic', stat.domain, value)
Exemplo n.º 4
0
def set_noise_stat(stat):
    """Update the noise statistics for a domain."""
    value = {
        'deltas': stat.deltas,
        'window_start': db.to_db_datetime(stat.window_start),
        'noisy': stat.is_noisy,
    }
    db.set('noise_statistic', stat.domain, value)