Aggregated Log Statistics Discussion
====================================

Date: Thursday May 01, 2014 @4pm EDT

Attending: Chris, Dave, Peter, Lauren, Matt, Ben, Robert, Skye

The CN log aggregation service harvests log records from both the MNs and CNs in order to enable reporting for a number of use cases.  This reporting is becoming increasingly important for DataONE reviews, and so we need to be sure that 1) The necessary log records are indexed accurately, 2) access to the log records is appropriate, and 3) The service API is well documented for client use (with or without a certifcate).

Log aggregation overview document: http://dev-testing.dataone.org:8080/hudson/job/API%20Documentation%20-%20trunk/javadoc/design/LogAggregator.html

Pertinent tasks:
Related goals (In Metacat):
Draft Agenda Items
------------------
    Current end points:
    https://cn-dev-ucsb-1.test.dataone.org/cn/v1/log (GET - getLogRecords() --> Types.Log)
    https://cn-dev-ucsb-1.test.dataone.org/solr/d1-cn-log/select

    The /v1/log endpoint has a different functionality than required of the solr request endpoint.

    The /log endpoint description: 
    http://mule1.dataone.org/ArchitectureDocs-current/apis/MN_APIs.html#MNCore.getLogRecords
    
     From the Architecture Docs:
     "CNRead.query(session, queryEngine, query) → OctetStream
        Submit a query against the specified queryEngine and return the response as 
        formatted by the queryEngine."
    
    Proposal:
        Use /cn/v1/query/{queryEngine}/{query} to handle queries to multiple backing stores:
        This proposal would be a v1 implementation, and that endpoints may change in the v2 API.
        
        Options:
        A. /cn/v1/query/log-solr
        B. /cn/v1/query/log
        C. /cn/v1/query/log.solr
        D. /cn/v1/query/logsolr <-- WINNER!
                        
Issues to resolve
-----------------
 
timing getLogRecords response (need to run from a CN):

  export TIMEFORMAT="%R"
  export NAMESPACE="d=http://ns.dataone.org/service/types/v1"
  export NODE="https://knb.ecoinformatics.org/knb/d1/mn"
  time  curl -s --cert cnode.pem \
    "${NODE}/v1/log?count=7000&fromDate=2014-04-01T05%3A28%3A07" \
    | xml sel -N "${NAMESPACE}" -t -m "/d:log" -o "N returned: " -v "@count" -n -o "Total: " -v "@total"