Skip to content

Commit

Permalink
codereview: simplify notation
Browse files Browse the repository at this point in the history
  • Loading branch information
chouetz committed Dec 18, 2024
1 parent ba99a37 commit bb0fbed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions tasks/libs/package/size.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@
# The below template contains the relative increase threshold for each package type
PACKAGE_SIZE_TEMPLATE = {
'amd64': {
'datadog-agent': {'deb': 140 * pow(10, 6)},
'datadog-iot-agent': {'deb': 10 * pow(10, 6)},
'datadog-dogstatsd': {'deb': 10 * pow(10, 6)},
'datadog-heroku-agent': {'deb': 70 * pow(10, 6)},
'datadog-agent': {'deb': int(140e6)},
'datadog-iot-agent': {'deb': int(10e6)},
'datadog-dogstatsd': {'deb': int(10e6)},
'datadog-heroku-agent': {'deb': int(70e6)},
},
'x86_64': {
'datadog-agent': {'rpm': 140 * pow(10, 6), 'suse': 140 * pow(10, 6)},
'datadog-iot-agent': {'rpm': 10 * pow(10, 6), 'suse': 10 * pow(10, 6)},
'datadog-dogstatsd': {'rpm': 10 * pow(10, 6), 'suse': 10 * pow(10, 6)},
'datadog-agent': {'rpm': int(140e6), 'suse': int(140e6)},
'datadog-iot-agent': {'rpm': int(10e6), 'suse': int(10e6)},
'datadog-dogstatsd': {'rpm': int(10e6), 'suse': int(10e6)},
},
'arm64': {
'datadog-agent': {'deb': 140 * pow(10, 6)},
'datadog-iot-agent': {'deb': 10 * pow(10, 6)},
'datadog-dogstatsd': {'deb': 10 * pow(10, 6)},
'datadog-agent': {'deb': int(140e6)},
'datadog-iot-agent': {'deb': int(10e6)},
'datadog-dogstatsd': {'deb': int(10e6)},
},
'aarch64': {'datadog-agent': {'rpm': 140 * pow(10, 6)}, 'datadog-iot-agent': {'rpm': 10 * pow(10, 6)}},
'aarch64': {'datadog-agent': {'rpm': int(140e6)}, 'datadog-iot-agent': {'rpm': int(10e6)}},
}


Expand Down
2 changes: 1 addition & 1 deletion tasks/libs/package/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def compare(self, size, ancestor_size):

@staticmethod
def mb(value):
return f"{value / pow(10, 6):.2f}MB"
return f"{value / 1e6:.2f}MB"

def log(self):
return f"{self.emoji} - {self.name} size {self.mb(self.size)}: {self.mb(self.diff)} diff[{self.diff}] with previous {self.mb(self.ancestor_size)} (max: {self.mb(self.threshold)})"
Expand Down

0 comments on commit bb0fbed

Please sign in to comment.