Exemple #1
0
    return top_authors_data

def microStudies(enddate, destdir):
    # Studies implemented in R

    # Demographics
    vizr.ReportDemographicsAgingSCM(enddate, destdir)
    vizr.ReportDemographicsBirthSCM(enddate, destdir)


if __name__ == '__main__':
    logging.basicConfig(level=logging.INFO,format='%(asctime)s %(message)s')
    logging.info("Starting SCM data source analysis")
    opts = read_options()
    period = getPeriod(opts.granularity)
    nperiod = getPeriod(opts.granularity, True)
    reports = opts.reports.split(",")
    # filtered bots

    bots = ["-Bot", "-Individual", "-Unknown"]
    # TODO: hack because VizR library needs. Fix in lib in future
    startdate = "'"+opts.startdate+"'"
    enddate = "'"+opts.enddate+"'"

    # Working at the same time with VizR and VizPy yet
    vizr.SetDBChannel (database=opts.dbname, user=opts.dbuser, password=opts.dbpassword)
    GrimoireSQL.SetDBChannel (database=opts.dbname, user=opts.dbuser, password=opts.dbpassword)

    aggData(period, startdate, enddate, opts.identities_db, opts.destdir)
    tsData (period, startdate, enddate, opts.identities_db, opts.destdir, opts.granularity, opts)
Exemple #2
0
    top_authors['authors.'] = Mediawiki.GetTopAuthorsMediaWiki(
        0, startdate, enddate, identities_db, bots, npeople)
    top_authors['authors.last year'] = Mediawiki.GetTopAuthorsMediaWiki(
        365, startdate, enddate, identities_db, bots, npeople)
    top_authors['authors.last month'] = Mediawiki.GetTopAuthorsMediaWiki(
        31, startdate, enddate, identities_db, bots, npeople)
    createJSON(top_authors, destdir + "/mediawiki-top.json")

    return (top_authors)


if __name__ == '__main__':
    logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s')
    logging.info("Starting Mediawiki data source analysis")
    opts = read_options()
    period = getPeriod(opts.granularity)
    reports = opts.reports.split(",")
    # filtered bots

    bots = ['wikibugs', 'gerrit-wm', 'wikibugs_', 'wm-bot', '']
    # TODO: hack because VizR library needs. Fix in lib in future
    startdate = "'" + opts.startdate + "'"
    enddate = "'" + opts.enddate + "'"

    # Working at the same time with VizR and VizPy yet
    # vizr.SetDBChannel (database=opts.dbname, user=opts.dbuser, password=opts.dbpassword)
    GrimoireSQL.SetDBChannel(database=opts.dbname,
                             user=opts.dbuser,
                             password=opts.dbpassword)

    tsData(period, startdate, enddate, opts.identities_db, opts.destdir,
        tickets_status = dataFrame2Dict(tickets_status)
        tickets_status = completePeriodIds(tickets_status)
        # rename key
        tickets_status[status] = tickets_status.pop("pending_tickets")
        #Issues per status
        current_status = vizr.GetCurrentStatus(period, startdate, enddate, identities_db, status)
        current_status = completePeriodIds(dataFrame2Dict(current_status))
        #Merging data
        evol = dict(evol.items() + current_status.items() + tickets_status.items())
    return evol

if __name__ == '__main__':
    logging.basicConfig(level=logging.INFO,format='%(asctime)s %(message)s')
    logging.info("Starting ITS data source analysis")
    opts = read_options()
    period = getPeriod(opts.granularity)
    reports = opts.reports.split(",")
    # filtered bots

    bots = ['-Bot']
    # TODO: hack because VizR library needs. Fix in lib in future
    startdate = "'"+opts.startdate+"'"
    enddate = "'"+opts.enddate+"'"

    # Working at the same time with VizR and VizPy yet
    vizr.SetDBChannel (database=opts.dbname, user=opts.dbuser, password=opts.dbpassword)
    GrimoireSQL.SetDBChannel (database=opts.dbname, user=opts.dbuser, password=opts.dbpassword)

    # backends
    backend = Backend(opts.backend)