Package models

Examples of models.DailyUsageStats


        DateTime now = DateTime.now();
        Date d3 = now.toDateMidnight().toDate();
        Date d2 = now.minusDays(1).toDateMidnight().toDate()
        Date d1 = now.minusDays(2).toDateMidnight().toDate()

        DailyUsageStats s1 = new DailyUsageStats(3L, 2L, 4L, 4L, d1);
        DailyUsageStats s2 = new DailyUsageStats(3L, 2L, 4L, 4L, d2);
        DailyUsageStats s3 = new DailyUsageStats(3L, 2L, 4L, 4L, d3);

        DatastoreUtil.put(Arrays.asList(s1, s2, s3), DailyUsageStats.MAPPER);
       
        assertEquals(3, DatastoreUtil.count("created", d1, d3, DailyUsageStats.all()));
        assertEquals(2, DatastoreUtil.count("created", d2, d3, DailyUsageStats.all()));
View Full Code Here


                rules += dRules;
                fileMoves += dFileMoves;

                UsageStats us = new UsageStats(users, rules, fileMoves);

                DailyUsageStats dus = new DailyUsageStats(dUsers, dRules, dFileMoves, dUniqueFileMoveUsers);

                Date cur = new DateTime().plusDays(i).toDate();
                us.created = cur;
                us.save();
                dus.created = cur;
                dus.save();
            }
            Logger.warn("Done generating fake data.");
        }

        User user = Login.getUser();
View Full Code Here

        long usersDelta = DatastoreUtil.count("created", from, to, User.all());
        long rulesDelta = DatastoreUtil.count("created", from, to, Rule.all());
        long fileMovesDelta = DatastoreUtil.count("when", from, to, FileMove.all());
        long uniqueFileMoveUsersDelta = UserStatsUtil.countUniqueFileMoveUsers("when", from, FileMove.all());
       
        DailyUsageStats delta = new DailyUsageStats(usersDelta, rulesDelta, fileMovesDelta, uniqueFileMoveUsersDelta);
        delta.save();
       
        Logger.info("Finished collecting daily stats: " + delta);
    }  
View Full Code Here

TOP

Related Classes of models.DailyUsageStats

Copyright © 2018 www.massapicom. 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.