Examples of DailyUsageSummary


Examples of org.eurekastreams.server.domain.DailyUsageSummary

                getDailyUniqueVisitorCountMapper, getDailyMessageResponseTimeMapper, insertMapper,
                usageMetricDataCleanupMapper, dayOfWeekStrategy, streamScopeIdsMapper, getTotalActivityCountMapper,
                getTotalCommentCountMapper, getTotalStreamContributorMapper, clearEntityManagerMapper,
                summaryDataMapper, discoverPageListsCacheRefreshingMapper, numberOfDaysToCacheSummaryDataFor);

        final DailyUsageSummary existingSummary = context.mock(DailyUsageSummary.class);
        final Date date = new Date(2011, 1, 22);

        context.checking(new Expectations()
        {
            {
View Full Code Here

Examples of org.eurekastreams.server.domain.DailyUsageSummary

        });

        this.insertMapper.setRequest(null);
        sut.execute(actionContext);

        DailyUsageSummary ds = (DailyUsageSummary) insertMapper.getRequest().getDomainEnity();
        Assert.assertEquals(uniqueVisitorCount, ds.getUniqueVisitorCount());
        Assert.assertEquals(pageViewCount, ds.getPageViewCount());
        Assert.assertEquals(streamViewerCount, ds.getStreamViewerCount());
        Assert.assertEquals(streamViewCount, ds.getStreamViewCount());
        Assert.assertEquals(streamContributorCount, ds.getStreamContributorCount());
        Assert.assertEquals(avgActivityResponseTime, ds.getAvgActivityResponseTime());
        Assert.assertEquals(messageCount, ds.getMessageCount());
        Assert.assertEquals(date, ds.getUsageDate());
        Assert.assertEquals(new Long(date.getTime()), ds.getUsageDateTimeStampInMs());

        context.assertIsSatisfied();
    }
View Full Code Here

Examples of org.eurekastreams.server.domain.DailyUsageSummary

        cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -4);
        final Date fourDaysAgo = DateDayExtractor.getStartOfDay(cal.getTime());

        // first result is ignored b/c it's outside the date range
        results.add(new DailyUsageSummary(10L, 20L, 30L, 40L, 50L, 60L, 70L, fourDaysAgo, //
                1308238511000L, 80L, 91L, 101L, 121L));
        results.add(new DailyUsageSummary(20L, 30L, 40L, 50L, 60L, 70L, 80L, threeDaysAgo, //
                1308238511000L, 90L, 100L, 110L, 130L));
        results.add(new DailyUsageSummary(30L, 40L, 50L, 60L, 70L, 80L, 90L, twoDaysAgo, //
                1308238511000L, 100L, 110L, 120L, 140L));
        results.add(new DailyUsageSummary(40L, 50L, 60L, 70L, 80L, 90L, 110L, yesterday, //
                1308238511000L, 110L, 120L, 130L, 150L));

        context.checking(new Expectations()
        {
            {
View Full Code Here

Examples of org.eurekastreams.server.domain.DailyUsageSummary

        cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -4);
        final Date fourDaysAgo = DateDayExtractor.getStartOfDay(cal.getTime());

        results.add(new DailyUsageSummary(10L, 20L, 30L, 40L, 50L, 60L, 70L, fourDaysAgo, //
                1308238511000L, 80L, 91L, 101L, 121L));
        results.add(new DailyUsageSummary(20L, 30L, 40L, 50L, 60L, 70L, 80L, threeDaysAgo, //
                1308238511000L, 90L, 100L, 110L, 130L));
        results.add(new DailyUsageSummary(40L, 50L, 60L, 70L, 80L, 90L, 110L, yesterday, //
                1308238511000L, 110L, 120L, 130L, 150L));

        context.checking(new Expectations()
        {
            {
View Full Code Here

Examples of org.eurekastreams.server.domain.DailyUsageSummary

        cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -4);
        final Date fourDaysAgo = DateDayExtractor.getStartOfDay(cal.getTime());

        results.add(new DailyUsageSummary(10L, 20L, 30L, 40L, 50L, 60L, 70L, fourDaysAgo, //
                1308238511000L, 80L, 91L, 101L, 121L));
        results.add(new DailyUsageSummary(20L, 30L, 40L, 50L, 60L, 70L, 80L, threeDaysAgo, //
                1308238511000L, 90L, 100L, 110L, 130L));
        results.add(new DailyUsageSummary(40L, 50L, 60L, 70L, 80L, 90L, 110L, yesterday, //
                1308238511000L, 110L, 120L, 130L, 150L));

        context.checking(new Expectations()
        {
            {
View Full Code Here

Examples of org.eurekastreams.server.domain.DailyUsageSummary

            logger.info("Ignoring " + reportDate + " - it's a weekend");
            return;
        }

        logger.info("Checking id daily usage summary data exists for " + reportDate);
        DailyUsageSummary existingSummary = getDailyUsageSummaryByDateMapper
                .execute(new UsageMetricDailyStreamInfoRequest(reportDate, null));
        clearEntityManagerMapper.execute(null);

        if (existingSummary != null)
        {
View Full Code Here

Examples of org.eurekastreams.server.domain.DailyUsageSummary

            start = System.currentTimeMillis();
            clearEntityManagerMapper.execute(null);
            messageCount = getDailyMessageCountMapper.execute(streamInfoRequest);
            timerLog += "\t8: " + (System.currentTimeMillis() - start);

            DailyUsageSummary data = new DailyUsageSummary(uniqueVisitorCount, pageViewCount, streamViewerCount,
                    streamViewCount, streamContributorCount, messageCount, avgActvityResponeTime, inDate,
                    inDate.getTime(), inStreamScopeId, totalActivityCount, totalCommentCount, totalContributorCount);

            // store this
            logger.info("Inserting daily usage metric data for " + inDate);
View Full Code Here

Examples of org.eurekastreams.server.domain.DailyUsageSummary

                // it's a weekday - we need a record for this date

                if (dataIndex < dailyStats.size())
                {
                    // there's still data records to look for
                    DailyUsageSummary record = dailyStats.get(dataIndex);
                    if (DateDayExtractor.getStartOfDay(record.getUsageDate()).getTime() == reportDate.getTime())
                    {
                        // this is the data we're looking for - add it to the result list
                        result.getDailyStatistics().add(record);

                        // bump up the position index for the next loop iteration
View Full Code Here

Examples of org.eurekastreams.server.domain.DailyUsageSummary

        getEntityManager().flush();

        // put in two records, one with 10 for values, one with 20
        for (int i = 1; i <= 2; i++)
        {
            DailyUsageSummary foo = new DailyUsageSummary();
            foo.setMessageCount(count * i);
            foo.setPageViewCount(count * i);
            foo.setStreamContributorCount(count * i);
            foo.setStreamViewCount(count * i);
            foo.setStreamViewerCount(count * i);
            foo.setUniqueVisitorCount(count * i);
            foo.setUsageDate(new Date(nowInMs - i * msInDay));
            foo.setAvgActivityResponseTime(count * i);
            foo.setUsageDateTimeStampInMs(1308238511000L);
            foo.setStreamViewStreamScopeId(null);

            getEntityManager().persist(foo);
            getEntityManager().flush();
            assertTrue(foo.getId() > 0);
        }

        // throw in some specific stream stats that will be ignored
        getEntityManager().persist(
                new DailyUsageSummary(1, 2, 3, 4, 5, 6, 7, new Date(nowInMs - 1 * msInDay), 1308238511000L, 3L, 1L,
                        2L, 5L));
        getEntityManager().persist(
                new DailyUsageSummary(1, 2, 3, 4, 5, 6, 7, new Date(nowInMs - 1 * msInDay), 1308238511000L, 4L, 1L,
                        2L, 5L));
        getEntityManager().persist(
                new DailyUsageSummary(1, 2, 3, 4, 5, 6, 7, new Date(nowInMs - 1 * msInDay), 1308238511000L, 5L, 1L,
                        2L, 5L));

        getEntityManager().flush();
        getEntityManager().clear();

View Full Code Here

Examples of org.eurekastreams.server.domain.DailyUsageSummary

        getEntityManager().flush();

        // put in two records, one with 100 for values, one with 200
        for (int i = 1; i <= 2; i++)
        {
            DailyUsageSummary foo = new DailyUsageSummary();
            foo.setMessageCount(count * i);
            foo.setPageViewCount(count * i);
            foo.setStreamContributorCount(count * i);
            foo.setStreamViewCount(count * i);
            foo.setStreamViewerCount(count * i);
            foo.setUniqueVisitorCount(count * i);
            foo.setUsageDate(new Date(nowInMs - (8 * 2 + i) * msInDay));
            foo.setAvgActivityResponseTime(count * i);
            foo.setStreamViewStreamScopeId(streamViewScopeId);
            foo.setUsageDateTimeStampInMs(1308238511000L);

            getEntityManager().persist(foo);
            getEntityManager().flush();
            assertTrue(foo.getId() > 0);
        }

        // throw in some stats that don't pertain to this stream that will be ignored
        getEntityManager().persist(
                new DailyUsageSummary(1, 2, 3, 4, 5, 6, 7, new Date(nowInMs - 6 * msInDay), 1308238511000L,
                        streamViewScopeId + 1, 1L, 2L, 5L));
        getEntityManager().persist(
                new DailyUsageSummary(1, 2, 3, 4, 5, 6, 7, new Date(nowInMs - 7 * msInDay), 1308238511000L,
                        streamViewScopeId + 1, 1L, 2L, 5L));
        getEntityManager().persist(
                new DailyUsageSummary(1, 2, 3, 4, 5, 6, 7, new Date(nowInMs - 8 * msInDay), 1308238511000L, null, 1L,
                        2L, 5L));

        getEntityManager().flush();
        getEntityManager().clear();

View Full Code Here
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.