Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

git-svn-id: svn://cherokee-project.com/cherokee/trunk@2989 5dc97367-9…

…7f1-0310-9951-d761b3857238
  • Loading branch information...
commit 6c666bf11eb71975626049ff0195d3530b97b18f 1 parent 4a75eb4
@alobbs alobbs authored
View
9 ChangeLog
@@ -1,5 +1,14 @@
2009-03-18 Alvaro Lopez Ortega <alvaro@octality.com>
+ * cherokee/virtual_server.h: Added the "collect_statistics"
+ configuration key, so it can be defined whether or not a virtual
+ server should collected traffic statistics.
+
+ * admin/PageVServer.py (PageVServer._op_apply_changes): Updates it
+ to support the new "collect_statistics" key.
+
+ * performance.conf.sample.pre: Don't collect statistics.
+
* 0.99.5 released
2009-03-17 Alvaro Lopez Ortega <alvaro@octality.com>
View
8 admin/PageVServer.py
@@ -39,6 +39,7 @@
NOTE_DIRECTORY_INDEX = 'List of name files that will be used as directory index. Eg: <em>index.html,index.php</em>.'
NOTE_MAX_UPLOAD_SIZE = 'The maximum size, in bytes, for POST uploads. (Default: unlimited)'
NOTE_KEEPALIVE = 'Whether this virtual server is allowed to use Keep-alive (Default: yes)'
+NOTE_COLLECT = 'Specifies if Traffic Statistics should be collected for the virtual server (Default: yes)'
NOTE_DISABLE_LOG = 'The Logging is currently enabled.'
NOTE_LOGGERS = 'Logging format. Apache compatible is highly recommended here.'
NOTE_ACCESSES = 'Back-end used to store the log accesses.'
@@ -425,8 +426,9 @@ def _render_basics (self, host):
txt += '<h2>Network</h2>'
table = TableProps()
- self.AddPropCheck (table, 'Keep-alive', '%s!keepalive'%(pre), True, NOTE_KEEPALIVE)
- self.AddPropEntry (table, 'Max Upload Size', '%s!post_max_len' % (pre), NOTE_MAX_UPLOAD_SIZE)
+ self.AddPropCheck (table, 'Keep-alive', '%s!keepalive'%(pre), True, NOTE_KEEPALIVE)
+ self.AddPropEntry (table, 'Max Upload Size', '%s!post_max_len' % (pre), NOTE_MAX_UPLOAD_SIZE)
+ self.AddPropCheck (table, 'Traffic Statistics', '%s!collect_statistics'%(pre), True, NOTE_COLLECT)
txt += self.Indent(table)
return txt
@@ -556,7 +558,7 @@ def _op_apply_changes (self, host, uri, post):
self.ApplyChanges_OptionModule ('%s!error_handler'%(pre), uri, post)
# Look for the checkboxes
- checkboxes = ['%s!keepalive'%(pre)]
+ checkboxes = ['%s!keepalive'%(pre), '%s!collect_statistics'%(pre)]
tmp = self._cfg['%s!rule'%(pre)]
if tmp and tmp.has_child():
for p in tmp:
View
3  cherokee/thread.c
@@ -631,7 +631,8 @@ process_active_connections (cherokee_thread_t *thd)
/* Maybe update traffic counters
*/
- if ((conn->traffic_next < thd->bogo_now) &&
+ if ((CONN_VSRV(vserver)->data.enabled) &&
+ (conn->traffic_next < thd->bogo_now) &&
((conn->rx != 0) || (conn->tx != 0)))
{
cherokee_connection_update_vhost_traffic (conn);
View
4 cherokee/virtual_server.c
@@ -69,6 +69,7 @@ cherokee_virtual_server_new (cherokee_virtual_server_t **vserver, void *server)
/* Data transference
*/
+ n->data.enabled = true;
n->data.rx = 0;
n->data.tx = 0;
CHEROKEE_MUTEX_INIT(&n->data.rx_mutex, NULL);
@@ -700,6 +701,9 @@ configure_virtual_server_property (cherokee_config_node_t *conf, void *data)
} else if (equal_buf_str (&conf->key, "post_max_len")) {
vserver->post_max_len = atoi (conf->val.buf);
+ } else if (equal_buf_str (&conf->key, "collect_statistics")) {
+ vserver->data.enabled = !! atoi (conf->val.buf);
+
} else if (equal_buf_str (&conf->key, "ssl_verify_depth")) {
vserver->verify_depth = !!atoi (conf->val.buf);
View
1  cherokee/virtual_server.h
@@ -66,6 +66,7 @@ typedef struct {
off_t rx;
CHEROKEE_MUTEX_T (tx_mutex);
CHEROKEE_MUTEX_T (rx_mutex);
+ cherokee_boolean_t enabled;
} data;
cuint_t verify_depth;
View
3  performance.conf.sample.pre
@@ -9,7 +9,7 @@
# Server
#
server!bind!1!port = 80
-server!timeout = 20
+server!timeout = 5
server!keepalive = 1
server!keepalive_max_requests = 1000
server!server_tokens = full
@@ -19,6 +19,7 @@ server!pid_file = %localstatedir%/run/cherokee.pid
# Default virtual server
#
vserver!1!nick = default
+vserver!1!collect_statistics = 0
vserver!1!document_root = %wwwroot%
vserver!1!rule!1!match = default
vserver!1!rule!1!handler = file
Please sign in to comment.
Something went wrong with that request. Please try again.