Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

JobAggregatorOperator.cpp 2.81 KB
Newer Older
1
//================================================================================
2
// Name        : JobAggregatorOperator.cpp
3
// Author      : Alessio Netti
Micha Müller's avatar
Micha Müller committed
4
// Contact     : info@dcdb.it
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright   : Leibniz Supercomputing Centre
// Description :
//================================================================================

//================================================================================
// This file is part of DCDB (DataCenter DataBase)
// Copyright (C) 2019-2019 Leibniz Supercomputing Centre
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
//================================================================================

28
#include "JobAggregatorOperator.h"
29

30
31
32
33
JobAggregatorOperator::JobAggregatorOperator(const std::string& name) :
    OperatorTemplate(name),
    AggregatorOperator(name),
    JobOperatorTemplate(name) {}
34

35
JobAggregatorOperator::JobAggregatorOperator(const JobAggregatorOperator& other) : OperatorTemplate(other._name), AggregatorOperator(other), JobOperatorTemplate(other._name) {}
Alessio Netti's avatar
Alessio Netti committed
36

37
JobAggregatorOperator::~JobAggregatorOperator() {}
38

39
void JobAggregatorOperator::compute(U_Ptr unit, qeJobData& jobData) {
40
    uint64_t now = getTimestamp() - _goBack;
41
42
43
44
    // Too early to fetch job data
    if(now < jobData.startTime) {
        return;
    }
45
46
47
    // Making sure that the aggregation boundaries do not go past the job start/end time
    uint64_t jobEnd   = jobData.endTime!=0 && now > jobData.endTime ? jobData.endTime : now;
    uint64_t jobStart = jobEnd-_window < jobData.startTime ? jobData.startTime : jobEnd-_window;
48
49
50
    // Clearing the buffer
    _buffer.clear();
    std::vector<std::string> sensorNames;
51
52
    // Job units are hierarchical, and thus we iterate over all sub-units associated to each single node
    for(const auto& subUnit : unit->getSubUnits()) {
53
54
        for (const auto &in : subUnit->getInputs()) {
            sensorNames.push_back(in->getName());
55
56
        }
    }
57
58
59
60
    if (!_queryEngine.querySensor(sensorNames, jobStart, jobEnd, _buffer, false)) {
        LOG(debug) << "Job Operator " << _name << ": cannot read from any sensor for unit " + unit->getName() + "!";
        return;
    }
61
62
    compute_internal(unit, _buffer);
}