From 0e3c4d40b8195c898db04bf337f72c5388201cf4 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Tue, 12 Mar 2019 15:00:15 -0400 Subject: [PATCH] Add some Eliot events related to fs notifications --- src/allmydata/util/eliotutil.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/allmydata/util/eliotutil.py b/src/allmydata/util/eliotutil.py index 0dce576ce..f92591d3e 100644 --- a/src/allmydata/util/eliotutil.py +++ b/src/allmydata/util/eliotutil.py @@ -18,6 +18,9 @@ __all__ = [ "opt_help_eliot_destinations", "validateInstanceOf", "validateSetMembership", + "MAYBE_NOTIFY", + "CALLBACK", + "INOTIFY_EVENTS", "RELPATH", "VERSION", "LAST_UPLOADED_URI", @@ -54,6 +57,7 @@ from eliot import ( ILogger, Message, Field, + ActionType, FileDestination, add_destinations, remove_destination, @@ -270,6 +274,27 @@ PATHINFO = Field( validateInstanceOf((type(None), PathInfo)), ) +INOTIFY_EVENTS = Field( + u"inotify_events", + humanReadableMask, + u"Details about a filesystem event generating a notification event.", + validateInstanceOf((int, long)), +) + +MAYBE_NOTIFY = ActionType( + u"filesystem:notification:maybe-notify", + [], + [], + u"A filesystem event is being considered for dispatch to an application handler.", +) + +CALLBACK = ActionType( + u"filesystem:notification:callback", + [INOTIFY_EVENTS], + [], + u"A filesystem event is being dispatched to an application callback." +) + def eliot_logging_service(reactor, destinations): """ Parse the given Eliot destination descriptions and return an ``IService``