libsysprof-analyze: add getters for min/max value

This commit is contained in:
Christian Hergert
2023-06-29 14:14:05 -07:00
parent 821bfc9bdf
commit 5220c6bc21
2 changed files with 20 additions and 0 deletions

View File

@ -384,3 +384,19 @@ _sysprof_document_counter_calculate_range (SysprofDocumentCounter *self)
if (max_value_changed)
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_MAX_VALUE]);
}
double
sysprof_document_counter_get_max_value (SysprofDocumentCounter *self)
{
g_return_val_if_fail (SYSPROF_IS_DOCUMENT_COUNTER (self), .0);
return self->max_value;
}
double
sysprof_document_counter_get_min_value (SysprofDocumentCounter *self)
{
g_return_val_if_fail (SYSPROF_IS_DOCUMENT_COUNTER (self), .0);
return self->min_value;
}

View File

@ -56,5 +56,9 @@ SYSPROF_AVAILABLE_IN_ALL
double sysprof_document_counter_get_value_double (SysprofDocumentCounter *self,
guint nth,
gint64 *time);
SYSPROF_AVAILABLE_IN_ALL
double sysprof_document_counter_get_max_value (SysprofDocumentCounter *self);
SYSPROF_AVAILABLE_IN_ALL
double sysprof_document_counter_get_min_value (SysprofDocumentCounter *self);
G_END_DECLS