aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/CostInfo.java
blob: a05d8c9d52b7cfa8ff274d422445eb274123913d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.resource;

import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.zone.ZoneId;

import java.math.BigDecimal;

/**
 * @author olaa
 */
public class CostInfo {

    private final ApplicationId applicationId;
    private final ZoneId zoneId;
    private final BigDecimal cpuHours;
    private final BigDecimal memoryHours;
    private final BigDecimal diskHours;
    private final BigDecimal gpuHours;
    private final BigDecimal cpuCost;
    private final BigDecimal memoryCost;
    private final BigDecimal diskCost;
    private final BigDecimal gpuCost;
    private final NodeResources.Architecture architecture;
    private final int majorVersion;


    public CostInfo(ApplicationId applicationId, ZoneId zoneId,
                    BigDecimal cpuHours, BigDecimal memoryHours, BigDecimal diskHours, BigDecimal gpuHours,
                    BigDecimal cpuCost, BigDecimal memoryCost, BigDecimal diskCost, BigDecimal gpuCost, NodeResources.Architecture architecture, int majorVersion) {
        this.applicationId = applicationId;
        this.zoneId = zoneId;
        this.cpuHours = cpuHours;
        this.memoryHours = memoryHours;
        this.diskHours = diskHours;
        this.gpuHours = gpuHours;
        this.cpuCost = cpuCost;
        this.memoryCost = memoryCost;
        this.diskCost = diskCost;
        this.gpuCost = gpuCost;
        this.architecture = architecture;
        this.majorVersion = majorVersion;
    }

    public ApplicationId getApplicationId() {
        return applicationId;
    }

    public ZoneId getZoneId() {
        return zoneId;
    }

    public BigDecimal getCpuHours() {
        return cpuHours;
    }

    public BigDecimal getMemoryHours() {
        return memoryHours;
    }

    public BigDecimal getDiskHours() {
        return diskHours;
    }

    public BigDecimal getGpuHours() {
        return gpuHours;
    }

    public BigDecimal getCpuCost() {
        return cpuCost;
    }

    public BigDecimal getMemoryCost() {
        return memoryCost;
    }

    public BigDecimal getDiskCost() {
        return diskCost;
    }

    public BigDecimal getGpuCost() {
        return gpuCost;
    }

    public BigDecimal getTotalCost() {
        return cpuCost.add(memoryCost).add(diskCost).add(gpuCost);
    }

    public NodeResources.Architecture getArchitecture() {
        return architecture;
    }

    public int getMajorVersion() {
        return majorVersion;
    }

}