You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by James Eisenhauer <ja...@gmail.com> on 2011/11/22 02:59:07 UTC

View Help Needed

So my head is like mush today and I can't seem to make sense of anything.
Fairly new CouchDB but I have made a few things and views but finding
myself challenged with the right approach to tackle my current needs.

So any help or point me at some good resources would be much appreciated.

1. First question are the wiki and the The Definitive Guide the best
resources for creating views?

2. Second question my problem.

I simplified/changed the model to make it easier to talk about.

Sample Document

_id
BuildName
System
TestName
Verdict
DateTime

I have many of these documents.  Each time a test is ran it is logged with
the above information.

I would like to output:

System|Build Name|# Pass|# Fail|# Errors|Test End (Date Time of last test
in Build)|Duration of tests(time between first test of build and last test)

Sorted newest end dates to oldest


I can get this so far:  System|Build Name|# of Tests


Any help in how to approach this would be awesome.

_best

jim

Re: View Help Needed

Posted by James Eisenhauer <ja...@gmail.com>.
thanks Paul & K.  this helps.

So I would say create 4 views(pass view, fail view, error view, etc..) and
then call each of them and somehow combine the json objects and output
them?  Sounds harder then it should be....but maybe it isn't....

jim

On Mon, Nov 21, 2011 at 10:43 PM, kowsik <ko...@gmail.com> wrote:

> Try this: http://blog.mudynamics.com/2009/04/03/interactive-couchdb/
>
> Might help you relax. :)
>
> K.
> ---
> http://blitz.io
> @pcapr
>
> On Mon, Nov 21, 2011 at 5:59 PM, James Eisenhauer
> <ja...@gmail.com> wrote:
> > So my head is like mush today and I can't seem to make sense of anything.
> > Fairly new CouchDB but I have made a few things and views but finding
> > myself challenged with the right approach to tackle my current needs.
> >
> > So any help or point me at some good resources would be much appreciated.
> >
> > 1. First question are the wiki and the The Definitive Guide the best
> > resources for creating views?
> >
> > 2. Second question my problem.
> >
> > I simplified/changed the model to make it easier to talk about.
> >
> > Sample Document
> >
> > _id
> > BuildName
> > System
> > TestName
> > Verdict
> > DateTime
> >
> > I have many of these documents.  Each time a test is ran it is logged
> with
> > the above information.
> >
> > I would like to output:
> >
> > System|Build Name|# Pass|# Fail|# Errors|Test End (Date Time of last test
> > in Build)|Duration of tests(time between first test of build and last
> test)
> >
> > Sorted newest end dates to oldest
> >
> >
> > I can get this so far:  System|Build Name|# of Tests
> >
> >
> > Any help in how to approach this would be awesome.
> >
> > _best
> >
> > jim
> >
>

Re: View Help Needed

Posted by kowsik <ko...@gmail.com>.
Try this: http://blog.mudynamics.com/2009/04/03/interactive-couchdb/

Might help you relax. :)

K.
---
http://blitz.io
@pcapr

On Mon, Nov 21, 2011 at 5:59 PM, James Eisenhauer
<ja...@gmail.com> wrote:
> So my head is like mush today and I can't seem to make sense of anything.
> Fairly new CouchDB but I have made a few things and views but finding
> myself challenged with the right approach to tackle my current needs.
>
> So any help or point me at some good resources would be much appreciated.
>
> 1. First question are the wiki and the The Definitive Guide the best
> resources for creating views?
>
> 2. Second question my problem.
>
> I simplified/changed the model to make it easier to talk about.
>
> Sample Document
>
> _id
> BuildName
> System
> TestName
> Verdict
> DateTime
>
> I have many of these documents.  Each time a test is ran it is logged with
> the above information.
>
> I would like to output:
>
> System|Build Name|# Pass|# Fail|# Errors|Test End (Date Time of last test
> in Build)|Duration of tests(time between first test of build and last test)
>
> Sorted newest end dates to oldest
>
>
> I can get this so far:  System|Build Name|# of Tests
>
>
> Any help in how to approach this would be awesome.
>
> _best
>
> jim
>

Re: View Help Needed

Posted by Paul Davis <pa...@gmail.com>.
Write map/reduce for each metric you're trying to collect and make an
HTTP request for each one. Often this confusion comes from the SQL
mindset, "One Query to rule them all, One Query to find them, One
Query to bring them all and in the darkness bind them" mantra from
reducing number of queries issued to a database.

On Mon, Nov 21, 2011 at 7:59 PM, James Eisenhauer
<ja...@gmail.com> wrote:
> So my head is like mush today and I can't seem to make sense of anything.
> Fairly new CouchDB but I have made a few things and views but finding
> myself challenged with the right approach to tackle my current needs.
>
> So any help or point me at some good resources would be much appreciated.
>
> 1. First question are the wiki and the The Definitive Guide the best
> resources for creating views?
>
> 2. Second question my problem.
>
> I simplified/changed the model to make it easier to talk about.
>
> Sample Document
>
> _id
> BuildName
> System
> TestName
> Verdict
> DateTime
>
> I have many of these documents.  Each time a test is ran it is logged with
> the above information.
>
> I would like to output:
>
> System|Build Name|# Pass|# Fail|# Errors|Test End (Date Time of last test
> in Build)|Duration of tests(time between first test of build and last test)
>
> Sorted newest end dates to oldest
>
>
> I can get this so far:  System|Build Name|# of Tests
>
>
> Any help in how to approach this would be awesome.
>
> _best
>
> jim
>

Re: View Help Needed

Posted by Aurélien Bénel <au...@utt.fr>.
Hi James,

> System
> Build Name
> # Pass
> # Fail|
> # Errors
> Test End (Date Time of last test in Build)
> Duration of tests(time between first test of build and last test)

I don't have much time to think about your case, but I think that most of what you want to do could be done with a single view which would do "_stats" on:
[System, Build, Attribute]=>Value

With "sum" (on values set to 1) you would have your numbers of pass, fails and errors.
With "min" and "max" on a numeric timestamp (like POSIX's) you would have the time at which the test has begun and ended.


Regards,

Aurélien