Metric
DearDiary.get_metric — Function
get_metric(id::Integer)::Optional{Metric}Get a Metric by id.
Arguments
id::Integer: The id of the metric to query.
Returns
A Metric object. If the record does not exist, return nothing.
DearDiary.get_metrics — Function
get_metrics(iteration_id::Integer)::Array{Metric, 1}Get all Metric for a given iteration.
Arguments
iteration_id::Integer: The id of the iteration to query.
Returns
An array of Metric objects.
DearDiary.create_metric — Function
create_metric(iteration_id::Integer, key::AbstractString, value::AbstractFloat)::NamedTuple{id::Optional{<:Int64},status::UpsertResult}Create a Metric.
Arguments
iteration_id::Integer: The id of the iteration to create the metric for.key::AbstractString: The key of the metric.value::AbstractFloat: The value of the metric.
Returns
- The created metric ID. If an error occurs,
nothingis returned. - An
UpsertResult.Createdif the record was successfully created,Duplicateif the record already exists,Unprocessableif the record violates a constraint, andErrorif an error occurred while creating the record.
DearDiary.update_metric — Function
update_metric(id::Integer, key::Optional{AbstractString}, value::Optional{AbstractFloat})::UpsertResultUpdate a Metric record.
Arguments
id::Integer: The id of the metric to update.key::Optional{AbstractString}: The new key for the metric.value::Optional{AbstractFloat}: The new value for the metric.
Returns
An UpsertResult. Updated if the record was successfully updated (or no changes were made), Duplicate if the record already exists, Unprocessable if the record violates a constraint, and Error if an error occurred while creating the record.
DearDiary.delete_metric — Function
delete_metric(id::Integer)::BoolDelete a Metric record.
Arguments
id::Integer: The id of the metric to delete.
Returns
true if the record was successfully deleted, false otherwise.