Created
June 10, 2014 19:59
-
-
Save jmchilton/a1b4f0bd3ce7189c0caf to your computer and use it in GitHub Desktop.
Examples of determining recent usage in dynamic destinations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
log = logging.getLogger( __name__ ) | |
from datetime import timedelta | |
def cool_runner( rule_helper, user_email ): | |
job_count = rule_helper.job_count( | |
for_user_email=user_email, | |
created_in_last=timedelta(days=10), | |
) | |
log.info(" job count is %s" % job_count ) | |
runtime_seconds = rule_helper.sum_job_runtime( | |
for_user_email=user_email, | |
updated_in_last=timedelta(days=10), | |
for_job_states=[ "ok" ], | |
for_destination="local" | |
) | |
log.info("runtime_seconds is %s" % runtime_seconds) | |
return "local" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment