added CE statistics counting
authorAleš Křenek <ljocha@ics.muni.cz>
Fri, 10 Dec 2004 11:58:15 +0000 (11:58 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Fri, 10 Dec 2004 11:58:15 +0000 (11:58 +0000)
org.glite.lb.client-interface/Makefile
org.glite.lb.client-interface/interface/statistics.h [new file with mode: 0644]

index bc7588d..39d467d 100644 (file)
@@ -20,7 +20,7 @@ AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3
 STAGETO=include/${globalprefix}/${lbprefix}
 STATIC_H=consumer.h context.h dump.h load.h notification.h notifid.h purge.h \
        Notification.h CountRef.h Job.h LoggingExceptions.h ServerConnection.h \
-       consumer_fake.h producer_fake.h
+       consumer_fake.h producer_fake.h statistics.h
 GEN_H=events.h jobstat.h producer.h Event.h JobStatus.h interface_version.h
 
 
diff --git a/org.glite.lb.client-interface/interface/statistics.h b/org.glite.lb.client-interface/interface/statistics.h
new file mode 100644 (file)
index 0000000..ce666a7
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef __EDG_WORKLOAD_LOGGING_CLIENT_STATISTICS_H__
+#define __EDG_WORKLOAD_LOGGING_CLIENT_STATISTICS_H__
+
+#include "edg/workload/logging/client/consumer.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Count the number of jobs which entered the specified state.
+ * \param group IN: group of jobs of interest, eg. DESTINATION = something
+ *             (XXX: this is the only query supported right now)
+ * \param major IN: major code of the state of interest
+ * \param minor IN: minor state code, eg. DONE_FAILED
+ * \param from,to INOUT: on input - requested interval of interest
+ *     on output - when the data were available
+ * \param rate OUT: average rate per second in which the jobs enter this state
+ * \param res_from, res_to: time resolution of the data (seconds)
+ */
+
+int edg_wll_StateRate(
+       edg_wll_Context context,
+       const edg_wll_QueryRec  *group,
+       edg_wll_JobStatCode     major,
+       int                     minor,
+       time_t  *from, 
+       time_t  *to,
+       float   *rate,
+       int     *res_from,
+       int     *res_to
+);
+
+
+/** Compute average time for which jobs stay in the specified state.
+ * \see edg_wll_StateRate for description of parameters.
+ */
+
+int edg_wll_StateDuration(
+       edg_wll_Context context,
+       const edg_wll_QueryRec  *group,
+       edg_wll_JobStatCode     major,
+       int                     minor,
+       time_t  *from, 
+       time_t  *to,
+       float   *duration,
+       int     *res_from,
+       int     *res_to
+);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __EDG_WORKLOAD_LOGGING_CLIENT_CONSUMER_H__ */
+