Download presentation
Presentation is loading. Please wait.
Published byScarlett Barton Modified over 8 years ago
1
Kelly Davis Monitoring and Event System Kelly Davis kdavis@aei.mpg.de AEI
2
Kelly Davis Outline Monitoring System Monitorables GATMetric Obtaining a GATMetric Examining a GATMetric GATMetricListener Adding/Removing a GATMetricListener Actually Listening Example Event System GATRequestListener Adding/Removing a GATRequestListener Actually Listening GATRequestNotifier Example
3
Kelly Davis Monitoring System Monitorables
4
Kelly Davis Monitoring System GATMetric A GATMetric is a subclass of GATObject which represents an observable quantity in the GAT system.
5
Kelly Davis Monitoring System Obtaining a GATMetric GATResult GATMonitorable_GetMetrics(GATObject_const mon, struct GATList_GATMetric *metrics) GATMonitorable
6
Kelly Davis Monitoring System Obtaining a GATMetric GATResult GATMonitorable_GetMetrics(GATObject_const mon, struct GATList_GATMetric *metrics) Metrics
7
Kelly Davis Monitoring System Examining a GATMetric
8
Kelly Davis Monitoring System GATMetricListener A GATMetricListener is an function pointer type, a callback, which a GAT application uses to monitor a GATMonitorable typedef GATResult (*GATMetricListener)(void *, GATMetricEvent);
9
Kelly Davis Monitoring System Adding/Removing a GATMetricListener GATResult GATMonitorable_AddMetricListener(GATObject object, GATMetricListener listener, void *listener_data, GATMetric metric, GATuint32 *cookie) GATResult GATMonitorable_RemoveRegisteredMetric(GATObject object, GATMetric metric, GATuint32 cookie)
10
Kelly Davis Monitoring System Actually listening… GATResult GATContext_ServiceActions(GATContext context, GATTimePeriod_const timeout)
11
Kelly Davis Monitoring System Example… … retcode = GATMonitorable_AddMetricListener(GATFile_ToGATObject(file), Listener_FileCopied, (char*) src, metric, &cookie); retcode = GATFile_Copy(file, target, GATFileMode_Overwrite); retcode = GATContext_ServiceActions(context, 0); … ( test/simple/file_copy_tests.c )
12
Kelly Davis Event System Event system sequence diagram…
13
Kelly Davis Event System GATRequestListener typedef GATResult (*GATRequestListener)(void *, GATRequestNotifier, void *) Callback data Notifier
14
Kelly Davis Event System Adding/Removing a GATRequestListener GATResult GATSelf_AddRequestListener(GATContext context, GATPreferences_const request_prefs, GATRequestListener listener, void *data, GATRequestType type, GATTable_const parameters, const char *name, GATuint32 *cookie) GATResult GATSelf_RemoveRequestListener(GATContext context, GATuint32 cookie)
15
Kelly Davis Event System GATResult GATContext_ServiceActions(GATContext context, GATTimePeriod_const timeout) Actually listening…
16
Kelly Davis Event System GATRequestNotifier typedef GATResult (* GATRequestNotifier )(void *, GATTable_const ) Callback data Returned data
17
Kelly Davis Event System Example… ( test/internal/gatrequest_tests.c)... retcode = GATSelf_AddRequestListener(context, NULL, on_checkpoint_issued, &break_loop, GATRequestType_Command, NULL, "checkpoint", &cookie); for (i = 0; i < 5; i++ ) { retcode = GATContext_ServiceActions (context, 0);... }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.