Example #1
0
    date DATE NOT NULL,
    state VARCHAR(11) NOT NULL,
    type VARCHAR(11) NOT NULL,
    issuecount INT NOT NULL
);
""" % TABLE_NAME

# Connect to and setup db:
db = MySQLdb.connect(host='localhost',
                     user='******',
                     passwd=CONFIG.MYSQL_PASSWORD,
                     db='businessmetrics',
                     port=3306)
Helper.create_table(db, SCHEMA)

stats = GithubStats()

today = date.today()
open_issues = defaultdict(lambda: defaultdict(int))
closed_issues = defaultdict(lambda: defaultdict(int))

for issue in stats.query(date_field='created',
                         query='repo:vector-im/riot-web is:issue'):
    label_names = [label.name for label in issue.labels]
    issue_type = ('feature' if 'feature' in label_names else
                  'bug' if 'bug' in label_names else
                  'maintenance' if 'maintenance' in label_names else 'other')

    opened = issue.created_at.date()
    closed = issue.closed_at.date(
    ) if issue.closed_at is not None else today + timedelta(days=1)
Example #2
0
    date DATE NOT NULL,
    state VARCHAR(11) NOT NULL,
    contributor VARCHAR(11) NOT NULL,
    prcount INT NOT NULL
);
""" % TABLE_NAME

# Connect to and setup db:
db = MySQLdb.connect(host='localhost',
                     user='******',
                     passwd=CONFIG.MYSQL_PASSWORD,
                     db='businessmetrics',
                     port=3306)
Helper.create_table(db, SCHEMA)

stats = GithubStats()

today = date.today()
open_issues = defaultdict(lambda: defaultdict(int))
closed_issues = defaultdict(lambda: defaultdict(int))

PAID_TEAM = [
    'bwindels', 'ara4n', 'dbkr', 'lampholder', 't3chguy', 'Kegsay',
    'erikjohnston', 'NegativeMjark', 'richvdh', 'lukebarnard1', 'uhoreg',
    'benparsons', 'Half-Shot', 'rxl881', 'illicitonion', 'superdump',
    'RiotTranslateBot', 'anoadragon453', 'RiotTranslate', 'manuroe', 'leonerd',
    'wmwragg', 'aviraldg', 'turt2live'
]

for issue in stats.query(query='repo:matrix-org/synapse is:pr'):
    # repo = '%s/%s' % (issue.repository.organization.name, issue.repository.name)
Example #3
0
import datetime

import pyodbc
import secrets

from dbcxn import insert_update, get_cxn


if __name__ == "__main__":
    stats = [
      #  DiscourseStats(),
        StackoverflowStats(),
        VimeoStats(),
        MeetupStats(),
        GithubStats(),
        SlackStats(),
        TwitterStats()
    ]

    all_stats = dict()

    for stat in stats:
        try:
            all_stats.update(stat.run())
        except Exception as e:
            print "Something went wrong for ", stat
            print e

    print all_stats
Example #4
0
    date DATE NOT NULL,
    state VARCHAR(11) NOT NULL,
    priority INT,
    issuetotal INT NOT NULL
);
""" % TABLE_NAME

# Connect to and setup db:
db = MySQLdb.connect(host='localhost',
                     user='******',
                     passwd=CONFIG.MYSQL_PASSWORD,
                     db='businessmetrics',
                     port=3306)
Helper.create_table(db, SCHEMA)

stats = GithubStats()

# Process results from github:
opened_issues = defaultdict(lambda: defaultdict(int))
closed_issues = defaultdict(lambda: defaultdict(int))

for issue in stats.query(date_field='created',
                         query='repo:matrix-org/synapse is:issue'):
    priority = None
    opened_issues[issue.created_at.date()][priority] += 1
    if issue.closed_at is not None:
        closed_issues[issue.closed_at.date()][priority] += 1

# Persist to db:
cursor = db.cursor()
delete_entries = """
Example #5
0
    date DATE NOT NULL,
    state VARCHAR(11) NOT NULL,
    contributor VARCHAR(11) NOT NULL,
    prchurn INT NOT NULL
);
""" % TABLE_NAME

# Connect to and setup db:
db = MySQLdb.connect(host='localhost',
                     user='******',
                     passwd=CONFIG.MYSQL_PASSWORD,
                     db='businessmetrics',
                     port=3306)
Helper.create_table(db, SCHEMA)

stats = GithubStats()

PAID_TEAM = ['bwindels',
             'ara4n',
             'dbkr',
             'lampholder',
             't3chguy',
             'Kegsay',
             'erikjohnston',
             'NegativeMjark',
             'richvdh',
             'lukebarnard1',
             'uhoreg',
             'benparsons',
             'Half-Shot',
             'rxl881',
CREATE TABLE IF NOT EXISTS
%s (
    date DATE NOT NULL,
    total INT NOT NULL
);
""" % TABLE_NAME

# Connect to and setup db:
db = MySQLdb.connect(host='localhost',
                     user='******',
                     passwd=CONFIG.MYSQL_PASSWORD,
                     db='businessmetrics',
                     port=3306)
Helper.create_table(db, SCHEMA)

stats = GithubStats()

date_format = '%Y-%m-%d'
today = date.today()

# Thanks for only returning 1000 results in your paginated result set, github.
untriaged = stats.small_query(
    query=
    'repo:vector-im/riot-web is:issue is:open -label:p1 -label:p2 -label:p3 -label:p4 -label:p5 -label:maintenance -label:bug -label:feature -label:support -label:wontfix'
)
untriaged_count = len(list(untriaged))

# Persist to db:
cursor = db.cursor()
delete_entries = """
DELETE FROM riotweb_untriaged_count