Skip to content

Commit

Permalink
[status page] Remove proxy info from it (#2634)
Browse files Browse the repository at this point in the history
Reading the proxy settings is a bit costly as it reparse the whole
config file and we do it every time we persist the forwarder status.

This information is not that valuable as it will be collected by a
flare anyway. Let’s just remove it
  • Loading branch information
Remi Hakim authored and gmmeyer committed Jun 29, 2016
1 parent f635869 commit c513899
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
23 changes: 0 additions & 23 deletions checks/check_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,15 +768,9 @@ def __init__(self, queue_length=0, queue_size=0, flush_count=0, transactions_rec
self.flush_count = flush_count
self.transactions_received = transactions_received
self.transactions_flushed = transactions_flushed
self.proxy_data = get_config(parse_args=False).get('proxy_settings')
self.hidden_username = None
self.hidden_password = None
self.too_big_count = too_big_count
if self.proxy_data and self.proxy_data.get('user'):
username = self.proxy_data.get('user')
hidden = len(username) / 2 if len(username) <= 7 else len(username) - 4
self.hidden_username = '*' * 5 + username[hidden:]
self.hidden_password = '*' * 10

def body_lines(self):
lines = [
Expand All @@ -789,20 +783,6 @@ def body_lines(self):
""
]

if self.proxy_data:
lines += [
"Proxy",
"=====",
"",
" Host: %s" % self.proxy_data.get('host'),
" Port: %s" % self.proxy_data.get('port')
]
if self.proxy_data.get('user'):
lines += [
" Username: %s" % self.hidden_username,
" Password: %s" % self.hidden_password
]

return lines

def has_error(self):
Expand All @@ -814,9 +794,6 @@ def to_dict(self):
'flush_count': self.flush_count,
'queue_length': self.queue_length,
'queue_size': self.queue_size,
'proxy_data': self.proxy_data,
'hidden_username': self.hidden_username,
'hidden_password': self.hidden_password,
'too_big_count': self.too_big_count,
'transactions_received': self.transactions_received,
'transactions_flushed': self.transactions_flushed
Expand Down
13 changes: 0 additions & 13 deletions win32/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,6 @@ <h2>Forwarder</h2>
<dt>Transactions rejected</dt> <dd>{{ forwarder['too_big_count'] }}</dd>
</dl>

{% if forwarder['proxy_data'] %}
<h3>Proxy</h3>

<dl>
<dt>Host</dt> <dd>{{ forwarder['proxy_data']['host'] }}</dd>
<dt>Port</dt> <dd>{{ forwarder['proxy_data']['port'] }}</dd>
{% if forwarder.get('hidden_username') %}
<dt>Username</dt> <dd>{{ forwarder['hidden_username'] }}</dd>
<dt>Password</dt> <dd>{{ forwarder['hidden_password'] }}</dd>
{% end %}
</dl>
{% end %}

<!-- Dogstatsd -->
<h2>DogstatsD</h2>

Expand Down

0 comments on commit c513899

Please sign in to comment.