1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use serde::Deserialize;

use crate::{Branch, Region};


/// Metrics relate to one specific function.
#[derive(Debug, PartialEq, Deserialize)]
pub struct FunctionMetrics<'a> {
    /// Absolute file pathes indexed via the file ids in `branches` and `regions` attrbiute.
    pub filenames: Vec<&'a str>,
    /// Source code level branches in this function. File ids of the branches are indices into
    /// the `filenames` array.
    pub branches: Vec<Branch>,
    /// Number of times this function was called.
    pub count: u64,
    /// Name of the function.
    pub name: &'a str,
    /// The regions in this function. File ids of the regions are indices into
    /// the `filenames` array.
    pub regions: Vec<Region>,
}