Skip to content

Commit

Permalink
OS check in allocation reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
dmelikyan committed Oct 2, 2017
1 parent 832ee43 commit ca08a03
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name = 'stackimpact',
version = '1.1.2',
version = '1.1.3',
description = 'StackImpact Python Agent',
author = 'StackImpact',
author_email = 'devops@stackimpact.com',
Expand Down
2 changes: 1 addition & 1 deletion stackimpact/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class Agent:

AGENT_VERSION = "1.1.2"
AGENT_VERSION = "1.1.3"
SAAS_DASHBOARD_ADDRESS = "https://agent-api.stackimpact.com"

def __init__(self, **kwargs):
Expand Down
2 changes: 2 additions & 0 deletions stackimpact/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ def load(self):
if self.agent.config.is_agent_enabled():
self.agent.error_reporter.start()
self.agent.process_reporter.start()
self.agent.log('Agent activated')
else:
self.agent.error_reporter.stop()
self.agent.process_reporter.stop()
self.agent.log('Agent deactivated')


except Exception:
Expand Down
2 changes: 1 addition & 1 deletion stackimpact/reporters/allocation_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def start(self):
if self.agent.get_option('allocation_profiler_disabled'):
return

if not min_version(3, 4):
if not (runtime_info.OS_LINUX or runtime_info.OS_DARWIN) or not min_version(3, 4):
self.agent.log('Memory allocation profiling is available for Python 3.4 or higher')
return

Expand Down
4 changes: 2 additions & 2 deletions tests/reporters/allocation_reporter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import threading

import stackimpact
from stackimpact.runtime import min_version
from stackimpact.runtime import min_version, runtime_info


class AllocationReporterTestCase(unittest.TestCase):

def test_record_allocation_profile(self):
if not min_version(3, 4):
if not (runtime_info.OS_LINUX or runtime_info.OS_DARWIN) or not min_version(3, 4):
return

stackimpact._agent = None
Expand Down

0 comments on commit ca08a03

Please sign in to comment.