def replicaPopularity(opts): popsettings = confSettings() dasHost = popsettings.getSetting("victorinterface", "DATASERVICE_HOST") popHost = popsettings.getSetting("victorinterface", "POPULARITY_HOST") #dasHost = 'https://cmsweb.cern.ch' #popHost = 'http://cms-popularity-prod.cern.ch' debug = 0 sitename = opts.SiteName incomplete = 0 #opts.incomplete timestart = opts.TStart timestop = opts.TStop if not sitename: raise Exception('You must provide input sitename') combiner = ReplicaPopularity(debug=debug, dasHost=dasHost, popHost=popHost) outdict = combiner.combine(sitename, timestart, timestop, incomplete, debug) logger.debug(outdict) return outdict
def main(): """Main function""" optmgr = DASOptionParser() opts, args = optmgr.get_opt() host = opts.host pophost = opts.pophost debug = opts.verbose incomplete = opts.incomplete timestart = opts.timestart timestop = opts.timestop try: sitename = args[0] except IndexError: raise Exception('You must provide input SITENAME') combiner = ReplicaPopularity(debug=debug, dasHost=host, popHost=pophost) # combiner.get_das_data(host, sitename, idx, limit) # combiner.get_pop_data(pophost, sitename, timestart, timestop) outdict = combiner.combine(sitename, timestart, timestop, incomplete, debug) logger.debug(outdict)