Package cron

Source Code of cron.UsageStatsGatherer

package cron;

import java.util.Map;

import models.DatastoreUtil;
import models.FileMove;
import models.Rule;
import models.UsageStats;
import models.User;
import play.Logger;

public class UsageStatsGatherer implements Job {

    @Override
    public void execute(Map<String, String> jobData) {
        long numUsers = DatastoreUtil.count(User.all());
        long numRules = DatastoreUtil.count(Rule.all());
        long numFileMoves = DatastoreUtil.count(FileMove.all());

        UsageStats stats = new UsageStats(numUsers, numRules, numFileMoves);
        stats.save();
       
        Logger.info("Finished collecting usage stats: " + stats);
    }

}
TOP

Related Classes of cron.UsageStatsGatherer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.