Examples of UsageMetricStreamSummaryRequest


Examples of org.eurekastreams.server.service.actions.requests.UsageMetricStreamSummaryRequest

        Long streamScopeId = null;
        if (inViewStreamScopeIdString != null && inViewStreamScopeIdString.length() > 0)
        {
            streamScopeId = Long.parseLong(inViewStreamScopeIdString);
        }
        UsageMetricModel.getInstance().fetch(new UsageMetricStreamSummaryRequest(DEFAULT_RECORD_COUNT, streamScopeId),
                true);
    }
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricStreamSummaryRequest

                oneOf(streamScopeIdsMapper).execute(with(date));
                will(returnValue(streamScopeIds));

                oneOf(summaryDataMapper).execute(
                        with(IsEqualInternally.equalInternally(new UsageMetricStreamSummaryRequest(
                                numberOfDaysToCacheSummaryDataFor, null))));

                allowing(clearEntityManagerMapper).execute(null);

                oneOf(discoverPageListsCacheRefreshingMapper).execute(null);
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricStreamSummaryRequest

     * Test execute.
     */
    @Test
    public void testExecute()
    {
        final UsageMetricStreamSummaryRequest request = new UsageMetricStreamSummaryRequest(3, 4L);
        final List<DailyUsageSummary> results = new ArrayList<DailyUsageSummary>();
        Calendar cal;

        cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -1);
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricStreamSummaryRequest

     * Test execute on data with a missing record in the middle.
     */
    @Test
    public void testExecuteWithAMissingDatum()
    {
        final UsageMetricStreamSummaryRequest request = new UsageMetricStreamSummaryRequest(4, 4L);
        final List<DailyUsageSummary> results = new ArrayList<DailyUsageSummary>();
        Calendar cal;

        cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -1);
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricStreamSummaryRequest

     * Test execute on data with a missing record in the middle, but that date is a weekend.
     */
    @Test
    public void testExecuteWithAMissingWeekendDatum()
    {
        final UsageMetricStreamSummaryRequest request = new UsageMetricStreamSummaryRequest(4, 4L);
        final List<DailyUsageSummary> results = new ArrayList<DailyUsageSummary>();
        Calendar cal;

        cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -1);
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricStreamSummaryRequest

     * @return the UsageMetricSummaryDTO
     */
    @Override
    public Serializable execute(final PrincipalActionContext inActionContext)
    {
        UsageMetricStreamSummaryRequest request = (UsageMetricStreamSummaryRequest) inActionContext.getParams();

        List<DailyUsageSummary> results = summaryDataMapper.execute(request);
        logger.info("Found " + results.size() + " summary results");

        UsageMetricSummaryDTO result = new UsageMetricSummaryDTO();

        // can't build the list directly - build up a temporary list so we can fill in the holes later
        List<DailyUsageSummary> dailyStats = new ArrayList<DailyUsageSummary>();

        // short-circuit if no results.
        if (results.size() == 0)
        {
            return result;
        }

        long msgCount = 0;
        long pageViewCount = 0;
        long streamContributorCount = 0;
        long streamViewCount = 0;
        long streamViewerCount = 0;
        long uniqueVisitorCount = 0;
        long avgActivityResponseTime = 0;

        long startingCommentCount = 0, finalCommentCount = 0;
        long startingActivityCount = 0, finalActivityCount = 0;

        Long totalActivityCount = null;
        Long totalCommentCount = null;
        Long totalContributorCount = null;

        Calendar day = Calendar.getInstance();
        day.add(Calendar.DATE, -request.getNumberOfDays());
        Date oldestAllowableReportDate = DateDayExtractor.getStartOfDay(new Date(day.getTimeInMillis()));

        day = Calendar.getInstance();
        day.add(Calendar.DATE, -1);
        Date latestReportDate = DateDayExtractor.getStartOfDay(new Date(day.getTimeInMillis()));
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricStreamSummaryRequest

            timerLog += "\t9: " + (System.currentTimeMillis() - start);

            // fetch the stream's data, which should be configured to force a cache refresh
            start = System.currentTimeMillis();
            clearEntityManagerMapper.execute(null);
            summaryDataMapper.execute(new UsageMetricStreamSummaryRequest(numberOfDaysToCacheSummaryDataFor,
                    inStreamScopeId));
            timerLog += "\t10: " + (System.currentTimeMillis() - start);
            timerLog += "\tTOTAL: " + (System.currentTimeMillis() - totalStart);
            logger.trace(timerLog);
        }
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricStreamSummaryRequest

            }

            PopularHashTagsModel.getInstance().fetch(
                    new StreamPopularHashTagsRequest(ScopeType.GROUP, group.getShortName()), true);
            UsageMetricModel.getInstance().fetch(
                    new UsageMetricStreamSummaryRequest(NUM_DAYS_FOR_METRICS, group.getStreamId()), true);
        }

    }
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricStreamSummaryRequest

        PopularHashTagsModel.getInstance().fetch(
                new StreamPopularHashTagsRequest(ScopeType.PERSON, person.getAccountId()), true);

        UsageMetricModel.getInstance().fetch(
                new UsageMetricStreamSummaryRequest(NUM_DAYS_FOR_METRICS, person.getStreamId()), true);

    }
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricStreamSummaryRequest

     * Test when the id is null.
     */
    @Test
    public void testWhenNull()
    {
        Assert.assertEquals("0", sut.transform(new UsageMetricStreamSummaryRequest(5, null)));
    }
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.