org.alfresco.bm.event.mongo
Class MongoResultService

java.lang.Object
  extended by org.alfresco.bm.event.mongo.MongoResultService
All Implemented Interfaces:
ResultService

public class MongoResultService
extends Object
implements ResultService

A Mongo-based implementation of the results for benchmark test runs.

Since:
1.0
Author:
Derek Hulley

Constructor Summary
MongoResultService(org.springframework.data.mongodb.core.MongoTemplate mongo, String collection)
          Construct a provider that works using the given Mongo instance and collection name.
 
Method Summary
 long countEventsByFailure()
           
 long countEventsByName(String name)
          Count the number of previously-completed events with the given name.
 long countEventsBySuccess()
           
 List<EventRecord> findEventsByName(String name, int skip, int limit)
          Find previously-completed events with the given name
 EventRecord recordResult(EventRecord result)
          Simply store an event for later use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MongoResultService

public MongoResultService(org.springframework.data.mongodb.core.MongoTemplate mongo,
                          String collection)
Construct a provider that works using the given Mongo instance and collection name.

Parameters:
mongo - the MongoDB template to use
collection - the name of the MongoDB collection
Method Detail

recordResult

public EventRecord recordResult(EventRecord result)
Description copied from interface: ResultService
Simply store an event for later use

Specified by:
recordResult in interface ResultService
Parameters:
result - the result to store
Returns:
Returns the result as persisted

findEventsByName

public List<EventRecord> findEventsByName(String name,
                                          int skip,
                                          int limit)
Description copied from interface: ResultService
Find previously-completed events with the given name

Specified by:
findEventsByName in interface ResultService
Parameters:
name - the name of the event as recorded
skip - the number of results to skip (for paging)
limit - the number of results to retrieve
Returns:
Returns any recorded results with the given name

countEventsByName

public long countEventsByName(String name)
Description copied from interface: ResultService
Count the number of previously-completed events with the given name.

Specified by:
countEventsByName in interface ResultService
Parameters:
name - the name of the event as recored
Returns:
the count

countEventsBySuccess

public long countEventsBySuccess()
Specified by:
countEventsBySuccess in interface ResultService
Returns:
the number of successfully completed events

countEventsByFailure

public long countEventsByFailure()
Specified by:
countEventsByFailure in interface ResultService
Returns:
the number of failed events


Copyright © 2012. All Rights Reserved.