Skip to content

Commit 8bb75df

Browse files
authored
Release 0.41.0 (DataDog#650)
1 parent 33f727c commit 8bb75df

File tree

7 files changed

+110
-41
lines changed

7 files changed

+110
-41
lines changed

.github/workflows/changelog.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Ensure labels"
2+
on: # yamllint disable-line rule:truthy
3+
pull_request:
4+
types:
5+
- labeled
6+
- unlabeled
7+
- opened
8+
- synchronize
9+
- reopened
10+
- ready_for_review
11+
12+
jobs:
13+
changelog:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check changelog labels
17+
if: github.event.pull_request.draft == false && false == contains(join(github.event.pull_request.labels.*.name, ','), 'changelog/')
18+
run: |-
19+
echo "::error Add 'changelog/*' label";
20+
exit 1;
21+
- name: OK
22+
run: echo "Thank you!"

.github/workflows/release.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
release:
6+
types:
7+
- published
8+
9+
jobs:
10+
build_wheels:
11+
name: Build wheels on Ubuntu 20.04
12+
runs-on: ubuntu-20.04
13+
if: github.event_name == 'release' && github.event.action == 'published'
14+
steps:
15+
- uses: actions/checkout@v2
16+
# Include all history and tags, needed for building the right version
17+
with:
18+
fetch-depth: 0
19+
20+
- uses: actions/setup-python@v2
21+
name: Install Python
22+
with:
23+
python-version: '3.9'
24+
25+
- name: Install datadog_checks_dev
26+
run: |
27+
python -m pip install datadog_checks_dev[cli]
28+
29+
- name: Set ddev pypi credentials
30+
run: |
31+
ddev config set pypi.user __token__
32+
ddev config set pypi.pass ${{ secrets.PYPI_TOKEN }}
33+
34+
- name: Publish the wheel to PyPI
35+
run: |
36+
ddev release upload . --sdist

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
CHANGELOG
2-
=========
1+
# Changelog
2+
3+
## 0.41.0 / 2021-04-15
4+
5+
* [Fixed] Fix decorator dependency for Python 2.7. See [#646](https://github.com/DataDog/datadogpy/pull/646). Thanks [artem888881](https://github.com/artem888881).
6+
* [Fixed] [dogstatsd] Fix buffer operation thread-safety. See [#642](https://github.com/DataDog/datadogpy/pull/642).
7+
* [Fixed] [dogstatsd] Improve performance of telemetry serialization. See [#641](https://github.com/DataDog/datadogpy/pull/641).
8+
39
## 0.40.1 / 2021-03-01
410

511
* [Fixed] Fix blocking connections in dogstatsd. See [#634](https://github.com/DataDog/datadogpy/pull/634).

RELEASING.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@ Our team will trigger the release pipeline.
2424
- Install [datadog_checks_dev](https://datadog-checks-base.readthedocs.io/en/latest/datadog_checks_dev.cli.html#installation) using Python 3.
2525
- Setup PyPI, see the internal documentation for more details
2626

27-
### Update Changelog
28-
#### Commands
29-
- See changes ready for release by running `ddev release show changes .` at the root of this project. Add any missing labels to PRs if needed.
30-
- Run `ddev release changelog . <NEW_VERSION>` to update the `CHANGELOG.md` file at the root of this repository
31-
- Commit the changes to the repository in a release branch and open a PR. Do not merge yet.
27+
### Update Changelog and version
3228

33-
### Release
29+
1. See changes ready for release by running `ddev release show changes .` at the root of this project. Add any missing labels to PRs if needed.
30+
1. Run `ddev release changelog . <NEW_VERSION>` to update the `CHANGELOG.md` file at the root of this repository
31+
1. Commit the changes to the repository in a release branch and open a PR. Do not merge yet.
3432
1. Bump the version in [`datadog/version.py`](datadog/version.py) and push it to your changelog PR. [Example](https://github.com/DataDog/datadogpy/pull/495/files#diff-2eeaed663bd0d25b7e608891384b7298)
3533
1. Merge the PR to master.
36-
1. Create the release on GitHub. [Example](https://github.com/DataDog/datadogpy/releases/tag/v0.33.0)
37-
1. Checkout the tag created at the previous step.
38-
1. Run `ddev release build .` and `ddev release upload --sdist . `.
39-
- Make sure that both an `sdist` and a [universal wheel](https://packaging.python.org/guides/distributing-packages-using-setuptools/#universal-wheels) have been uploaded to [PyPI](https://pypi.python.org/pypi/datadog/).
40-
1. Bump the version again in `datadog/version.py` to a dev version (e.g. `0.34.0` -> `0.34.1.dev`), open a PR and merge it to master.
34+
35+
### Release
36+
1. Create the release on GitHub. [Example](https://github.com/DataDog/datadogpy/releases/tag/0.40.0)
37+
1. A github action will kick off that builds and publishes this tag to PyPI. Confirm the [release is available](https://pypi.org/project/datadog/#history)
38+
1. Bump the version again in `datadog/version.py` to a dev version (e.g. `0.34.0` -> `0.34.1.dev`), open a PR and merge it to master.

datadog/dogstatsd/base.py

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,17 @@
5454
# Telemetry pre-computed formatting string. Pre-computation
5555
# increases throughput of composing the result by 2-15% from basic
5656
# '%'-based formatting with a `join`.
57-
TELEMETRY_FORMATTING_STR = "\n".join([
58-
"datadog.dogstatsd.client.metrics:%s|c|#%s",
59-
"datadog.dogstatsd.client.events:%s|c|#%s",
60-
"datadog.dogstatsd.client.service_checks:%s|c|#%s",
61-
"datadog.dogstatsd.client.bytes_sent:%s|c|#%s",
62-
"datadog.dogstatsd.client.bytes_dropped:%s|c|#%s",
63-
"datadog.dogstatsd.client.packets_sent:%s|c|#%s",
64-
"datadog.dogstatsd.client.packets_dropped:%s|c|#%s",
65-
])
57+
TELEMETRY_FORMATTING_STR = "\n".join(
58+
[
59+
"datadog.dogstatsd.client.metrics:%s|c|#%s",
60+
"datadog.dogstatsd.client.events:%s|c|#%s",
61+
"datadog.dogstatsd.client.service_checks:%s|c|#%s",
62+
"datadog.dogstatsd.client.bytes_sent:%s|c|#%s",
63+
"datadog.dogstatsd.client.bytes_dropped:%s|c|#%s",
64+
"datadog.dogstatsd.client.packets_sent:%s|c|#%s",
65+
"datadog.dogstatsd.client.packets_dropped:%s|c|#%s",
66+
]
67+
)
6668

6769

6870
class DogStatsd(object):
@@ -374,8 +376,8 @@ def close_buffer(self):
374376
invocation.
375377
"""
376378

377-
if not hasattr(self, 'buffer'):
378-
raise BufferError('Cannot close buffer that was never opened')
379+
if not hasattr(self, "buffer"):
380+
raise BufferError("Cannot close buffer that was never opened")
379381

380382
try:
381383
self._send = self._send_to_server
@@ -591,13 +593,20 @@ def _flush_telemetry(self):
591593
telemetry_tags = ",".join(self._add_constant_tags(self._client_tags))
592594

593595
return TELEMETRY_FORMATTING_STR % (
594-
self.metrics_count, telemetry_tags,
595-
self.events_count, telemetry_tags,
596-
self.service_checks_count, telemetry_tags,
597-
self.bytes_sent, telemetry_tags,
598-
self.bytes_dropped, telemetry_tags,
599-
self.packets_sent, telemetry_tags,
600-
self.packets_dropped, telemetry_tags
596+
self.metrics_count,
597+
telemetry_tags,
598+
self.events_count,
599+
telemetry_tags,
600+
self.service_checks_count,
601+
telemetry_tags,
602+
self.bytes_sent,
603+
telemetry_tags,
604+
self.bytes_dropped,
605+
telemetry_tags,
606+
self.packets_sent,
607+
telemetry_tags,
608+
self.packets_dropped,
609+
telemetry_tags,
601610
)
602611

603612
def _is_telemetry_flush_time(self):

datadog/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.41.0.dev"
1+
__version__ = "0.41.0"

tests/unit/dogstatsd/test_statsd.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -738,15 +738,13 @@ def batch_metrics(index, dsd):
738738

739739
# This is a bit of a tricky thing to test for - initially only our data packet is
740740
# sent but then telemetry is flushed/reset and the subsequent metric xmit includes
741-
# the telemetry data for the previous packet. The reason for 726 -> 727 increase is
742-
# because packet #2 sends a three digit byte count ("726") that then increases the
743-
# next metric size by 1 byte.
744-
expected_xfer_metrics = [
745-
(33, 1),
746-
(726, 2),
747-
(727, 2),
748-
(727, 2),
749-
]
741+
# the telemetry data for the previous packet.
742+
expected_xfer_metrics = [(33, 1)]
743+
for i in range(num_threads - 1):
744+
expected_xfer_metrics.append(
745+
(33 + len(telemetry_metrics(
746+
metrics=2, bytes_sent=expected_xfer_metrics[i][0], packets_sent=expected_xfer_metrics[i][1]
747+
)), 2))
750748

751749
for idx in range(num_threads):
752750
expected_message = "page.%d.views:123|g\ntimer.%d:123|ms" % (idx, idx)

0 commit comments

Comments
 (0)