# Metric definitions in ap_association

AssociationTime: &RunningTime
    description: Wall-clock time elapsed in AssociationTask.
    unit: s
    reference: &ApMetrics
        url: https://confluence.lsstcorp.org/pages/viewpage.action?spaceKey=~ebellm&title=Alert+Production+Metrics
    tags:
        - ap_verify
        - workflow
        - task
        - monitoring

DiaPipelineTime:
    <<: *RunningTime
    description: Wall-clock time elapsed in DiaPipelineTask.

MapDiaSourceTime:
    <<: *RunningTime
    description: Wall-clock time elapsed in MapDiaSourceTask.

LoadDiaCatalogsTime:
    <<: *RunningTime
    description: Wall-clock time elapsed in LoadDiaCatalogsTask.

DiaForcedSourceTime:
    <<: *RunningTime
    description: Wall-clock time elapsed in DiaForcedSourceTask.

PackageAlertsTime:
    <<: *RunningTime
    description: Wall-clock time elapsed in PackageAlertsTask.

AssociationMemory: &Memory
    description: Maximum resident set size in or before any AssociationTask process.
    unit: byte
    reference:
        url: https://confluence.lsstcorp.org/pages/viewpage.action?spaceKey=~ebellm&title=Alert+Production+Metrics
    tags:
        - ap_verify
        - workflow
        - task
        - monitoring

DiaPipelineMemory:
    <<: *Memory
    description: Maximum resident set size in or before any DiaPipelineTask process.

DiaForcedSourceMemory:
    <<: *Memory
    description: Maximum resident set size in or before any DiaForcedSourceTask process.

PackageAlertsMemory:
    <<: *Memory
    description: Maximum resident set size in or before any PackageAlertsTask process.

numNewDiaObjects: &SourceCount
    description: Number of DIASources that create new DIAObjects in this image.
    unit: ct
    reference: *ApMetrics
    tags: &DiffimCcdMetric !!set
        ? ap_verify
        ? diffim
        ? assoc
        ? CCD

numUnassociatedDiaObjects:
    <<: *SourceCount
    description: Number of previously-known DIAObjects that do not have detected DIASources here.

totalUnassociatedDiaObjects:
    <<: *SourceCount
    description: Number of DIAObjects that are only detected once
    tags: &DatasetMetric !!set
        ? ap_verify
        ? assoc
        ? dataset

fracUpdatedDiaObjects: &SourceFraction
    description: Fraction of known previously-known DIAObjects that have detected DIAsources here.
    unit: '%'
    reference: *ApMetrics
    tags: *DiffimCcdMetric
