triggr/state/
statistics.rs

1use anchor_lang::prelude::*;
2
3#[derive(Clone, Default, PartialEq, Eq, Debug, AnchorDeserialize, AnchorSerialize)]
4pub struct Statistics {
5    /// The number of times the task has been executed.
6    pub execution_count: u64,
7
8    /// The timestamp when the task was last triggered.
9    pub last_executed_at: i64,
10}
11
12impl Statistics {
13    pub const MIN_SIZE: usize = 8 + 8;
14
15    pub fn new() -> Self {
16        Statistics {
17            execution_count: 0,
18            last_executed_at: 0,
19        }
20    }
21}