Hi, Happy New Year 2026!
We are quite keen to show our customer how well a deployed SRM solution is performing. We are thinking about being able to report on number of bookings created, successfully started, failed, etc.
Does SRM have a built-in mechanism that tracks this?
Otherwise, what would be the recommended way to extract the above-mentioned type of metrics.
Hi Bing,
The SRM solution has no built-in way to track these metrics. You would have to build something yourself. In order to retrieve statistics like the number of created/failed/started bookings, you can do a count operation on the ReservationInstance object (available since version DM version 10.4.2). I will provide some examples below that you can send from within an ad-hoc GQI data source, an automation script… I will recommend to not overdo it with the number of queries.
You will need a reference to the SLSRMLibrary dll and import the relevant namespaces in your script for the examples below.
Getting the number of created ReservationInstance objects in the last 7 days:
var rmHelper = new ResourceManagerHelper(engine.SendSLNetSingleResponseMessage);
var createdAtFilter = ReservationInstanceExposers.CreatedAt.GreaterThan(DateTime.UtcNow.AddDays(-7));
var amount = rmHelper.CountReservationInstances(createdAtFilter);
Number of those bookings that completed successfully in the past 7 days:
var windowEnd = DateTime.UtcNow;
var windowStart = windowEnd.AddDays(-7);
var filter = ReservationInstanceExposers.Start.LessThan(windowEnd).AND(ReservationInstanceExposers.End.GreaterThan(windowStart)).AND(ReservationInstanceExposers.Properties.DictField(KnownProperties.BookingLifeCycle).Equal(GeneralStatus.Completed.GetStringValue()));
var amount = rmHelper.CountReservationInstances(filter);
Number of bookings that failed in the past 7 days (there are multiple statuses that can indicate a failed booking):
var failedStatuses = new [] { GeneralStatus.Failed, GeneralStatus.FailedStarting, GeneralStatus.FailedRunning, GeneralStatus.FailedRunning, GeneralStatus.FailedCompleted};
var statusFilters = failedStatuses.Select(failedStatus =>
ReservationInstanceExposers.Properties.DictField(KnownProperties.BookingLifeCycle).Equal(failedStatus.GetStringValue())).ToArray();
var filter = ReservationInstanceExposers.Start.LessThan(windowEnd).AND(ReservationInstanceExposers.End.GreaterThan(windowStart))
.AND(new ORFilterElement<ReservationInstance>(statusFilters));
var amount = rmHelper.CountReservationInstances(filter);
There are some more examples of filters throughout the docs on the resource manager helper. Note that the examples there show how to read a complete reservation instance, which you should not do if you want to calculate statistics like the above. A count operation on bookings is quite performant (this is a database-level count in the background), but reading all reservation instances can be very costly, depending on the number of instances retrieved. I would avoid doing a read of complete reservation instances for calculating metrics like these and try to limit the number of count operations to the most interesting metrics.
Note that there is also the built-in GQI adapter for bookings, where the count operation is also optimized to do a database-level count, as long as there are no other aggregations in the query (such as grouping). Unfortunately, it is not possible to filter on properties such as the booking lifecycle with the adapter.
Hope this helps.