Hello,
I have 2 documents recorded at request or response of a service call  :
Entity Request
 {
  "type":"REQ",
  "reqid":"MES0",
   "service":"service0",
   "time":1,
 }
Entity response
 {
  "type":"RES",
  "reqid":"MES0",
   "time":10,
 }

I need to create following statistics:
Total service call duration for each call (reqid is unique for each service call) :
similar to query :
select c1.reqid,c1.service,c1.time as REQTime, c2.time as RESTime , c2.time - c1.time as TotalTime from collection c1 left join collection c2 on c1.reqid = c2.reqid and c2.type = 'RES'

 {
   "reqid":"MES0",
   "service":service0,
   "REQTime":1,
   "RESTime":10,
   "TotalTime":9
 }

Average service call duration :
similar to query :
select c1.service, avg(c2.time - c1.time) as AvgTime, count(*) from collection c1 left join collection c2 on c1.reqid = c2.reqid and c2.type = 'RES' group by c1.service

 {
   "service":service0,
   "AvgTime":9,
   "Count": 1
 }

I Tried to find solution in archives, I experimented with !join, subquery, _query_ etc. but not succeeded.. I can probably use streaming and leftOuterJoin, but in my understanding this functionality is not ready for production. Is SOLR capable to fulfill these use cases? What are the key functions to focus on ?

Thanks' Pavel








Reply via email to