예제 #1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
stati_net.example
~~~~~~~~~~~~~~~~~

HTTP client

:copyright: (c) 2012 - 2013 by GottWall team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
:github: http://github.com/GottWall/stati-python-net
"""

from stati_net import HTTPClient

private_key = "dwefwefwefwecwef"
public_key = "my_public_key"
project = "test_project"

host = "http://127.0.0.1:8890"

cli = HTTPClient(
    private_key=private_key,
    public_key=public_key,
    project=project,
    host=host,
    prefix=None)

for x in xrange(10):
    cli.incr(name="orders", value=2, filters={"current_status": "Completed"})
예제 #2
0
import human_curl as hurl
from urlparse import urljoin
from datetime import datetime
from stati_net import HTTPClient
from random import choice

private_key = "secret_key"
public_key = "public_key"
project = "test_project"

host = "127.0.0.1"

client = HTTPClient(
    private_key=private_key,
    public_key=public_key,
    project=project,
    host=host,
    port=8890,
    prefix="")


from human_curl.async import AsyncClient

test_data = {"name": "orders", "value": 2, "timestamp": datetime.now(),
             "filters": {"status": ["Completed", "Test"]}}

success_count = 0
fail_count = 0
bad_response_count = 0

def success_callback(response, **kwargs):
예제 #3
0
:copyright: (c) 2012 - 2013 by GottWall team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
:github: http://github.com/GottWall/stati-python-net
"""
import logging
from logging import getLogger

logger = getLogger('stati')
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())

from stati_net import HTTPClient

private_key = "secret_key"
public_key = "public_key"
project = "test_project"

host = "127.0.0.1"

cli = HTTPClient(
    private_key=private_key,
    public_key=public_key,
    project=project,
    host=host,
    port=8890,
    prefix="")

for x in xrange(100000):
    cli.incr(name="orders", value=2, filters={"current_status": "Completed"})
예제 #4
0
import human_curl as hurl
from urllib.parse import urljoin
from datetime import datetime
from stati_net import HTTPClient
from random import choice

private_key = "secret_key"
public_key = "public_key"
project = "test_project"

host = "127.0.0.1"

client = HTTPClient(private_key=private_key,
                    public_key=public_key,
                    project=project,
                    host=host,
                    port=8890,
                    prefix="")

from human_curl. async import AsyncClient

test_data = {
    "name": "orders",
    "value": 2,
    "timestamp": datetime.now(),
    "filters": {
        "status": ["Completed", "Test"]
    }
}

success_count = 0