This repository was archived by the owner on Sep 2, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010### Added
1111
1212- Send current system memory usage and total available memory together with metrics on Linux systems.
13+ - Add platform name to sent Apilytics version info.
1314
1415## [ 1.3.0] - 2022-02-02
1516
Original file line number Diff line number Diff line change 22import json
33import platform
44import re
5+ import sys
56import time
67import types
78import urllib .error
@@ -44,7 +45,7 @@ class ApilyticsSender:
4445
4546 _apilytics_version_template : ClassVar [
4647 str
47- ] = f"{{integration}}/{ apilytics .__version__ } ;python/{ platform .python_version ()} "
48+ ] = f"{{integration}}/{ apilytics .__version__ } ;python/{ platform .python_version ()} ;{{library}}; { sys . platform } "
4849
4950 def __init__ (
5051 self ,
@@ -85,10 +86,9 @@ def __init__(
8586 self ._status_code : Optional [int ] = None
8687
8788 self ._apilytics_version = self ._apilytics_version_template .format (
88- integration = apilytics_integration or "apilytics-python-core"
89+ integration = apilytics_integration or "apilytics-python-core" ,
90+ library = integrated_library or "" ,
8991 )
90- if integrated_library :
91- self ._apilytics_version += f";{ integrated_library } "
9292
9393 def __enter__ (self ) -> "ApilyticsSender" :
9494 """Start the timer, measuring how long the ``with`` block takes to execute."""
Original file line number Diff line number Diff line change 11import platform
2+ import sys
23import unittest .mock
34
45import django .test
@@ -27,7 +28,7 @@ def test_middleware_should_call_apilytics_api(
2728 # urllib calls `capitalize()` on the header keys.
2829 "Content-type" : "application/json" ,
2930 "X-api-key" : "dummy-key" ,
30- "Apilytics-version" : f"apilytics-python-django/{ apilytics .__version__ } ;python/{ platform .python_version ()} ;django/{ django .__version__ } " ,
31+ "Apilytics-version" : f"apilytics-python-django/{ apilytics .__version__ } ;python/{ platform .python_version ()} ;django/{ django .__version__ } ; { sys . platform } " ,
3132 }
3233
3334 data = tests .conftest .decode_request_data (call_kwargs ["data" ])
Original file line number Diff line number Diff line change 11import platform
2+ import sys
23import unittest .mock
34
45import fastapi .middleware
@@ -32,7 +33,7 @@ def test_middleware_should_call_apilytics_api(
3233 # urllib calls `capitalize()` on the header keys.
3334 "Content-type" : "application/json" ,
3435 "X-api-key" : "dummy-key" ,
35- "Apilytics-version" : f"apilytics-python-fastapi/{ apilytics .__version__ } ;python/{ platform .python_version ()} ;fastapi/{ fastapi .__version__ } " ,
36+ "Apilytics-version" : f"apilytics-python-fastapi/{ apilytics .__version__ } ;python/{ platform .python_version ()} ;fastapi/{ fastapi .__version__ } ; { sys . platform } " ,
3637 }
3738
3839 data = tests .conftest .decode_request_data (call_kwargs ["data" ])
Original file line number Diff line number Diff line change 11import platform
2+ import sys
23import textwrap
34import unittest .mock
45import urllib .error
@@ -31,7 +32,7 @@ def test_apilytics_sender_should_call_apilytics_api(
3132 # urllib calls `capitalize()` on the header keys.
3233 "Content-type" : "application/json" ,
3334 "X-api-key" : "dummy-key" ,
34- "Apilytics-version" : f"apilytics-python-core/{ apilytics .__version__ } ;python/{ platform .python_version ()} " ,
35+ "Apilytics-version" : f"apilytics-python-core/{ apilytics .__version__ } ;python/{ platform .python_version ()} ;; { sys . platform } " ,
3536 }
3637
3738 data = tests .conftest .decode_request_data (call_kwargs ["data" ])
You can’t perform that action at this time.
0 commit comments