Skip to content

Collecting metrics at the start of update methods vs at the end #1

@paulyoung

Description

@paulyoung

The README contains this example:

#[ic_cdk_macros::update(name = "doThis")]
pub async fn do_this() -> () {
    canistergeek_ic_rust::monitor::collect_metrics();
    canistergeek_ic_rust::logger::log_message(String::from("do_this"));
    // rest part of the your method...
}

Is there any reason not to do something like this instead?

#[ic_cdk_macros::update(name = "doThis")]
pub async fn do_this() -> () {
    canistergeek_ic_rust::logger::log_message(String::from("do_this"));
    // rest part of the your method...
    canistergeek_ic_rust::monitor::collect_metrics();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions