Skip to content

Commit a5c8464

Browse files
committed
Add Fuzzer.created_at field
We want to start tracking more metrics around blackbox fuzzers. We currently only track the last updated timestamp of a fuzzer. This introduces a craeted_at timestamp which is set when creating a fuzzer. Testing: Ran a local server and creatd a Fuzzer to verify the field is set.
1 parent ef4af5d commit a5c8464

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/appengine/handlers/fuzzers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ def post(self):
251251
fuzzer = data_types.Fuzzer()
252252
fuzzer.name = name
253253
fuzzer.revision = 0
254+
fuzzer.created_at = datetime.datetime.now(tz=datetime.timezone.utc).replace(
255+
tzinfo=None)
254256
return self.apply_fuzzer_changes(fuzzer, upload_info)
255257

256258

src/clusterfuzz/_internal/datastore/data_types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ class Blacklist(Model):
261261
class Fuzzer(Model):
262262
"""Represents a fuzzer."""
263263

264+
# Created at timestamp. Not set for fuzzers created before this field was
265+
# added.
266+
created_at = ndb.DateTimeProperty()
267+
264268
# Additionally allows '.' and '@' over NAME_CHECK_REGEX.
265269
VALID_NAME_REGEX = re.compile(r'^[a-zA-Z0-9_@.-]+$')
266270

0 commit comments

Comments
 (0)