Loading ...
Sorry, an error occurred while loading the content.

date clustering stack bars

Expand Messages
  • Robin Duggar <rduggar@pobox.com>
    Steve, I ve looked at all the examples, and played around a bit. However, I can t seem to find the way to do something. Please help. I need to graph the
    Message 1 of 4 , Feb 5, 2003
    • 0 Attachment
      Steve,

      I've looked at all the examples, and played around a bit. However, I
      can't seem to find the way to do something. Please help.

      I need to graph the number of packets passed inbound & outbound on
      each interface of a server, by day. Each interface is a stack with
      its inbound & outbound layers. I have figured out how to do this for
      a file with just one interface's data in it. However, I would like
      to cluster the stacks for each interface by day.

      My data currently looks like this:

      eri0 20030201 4502505 2304593
      eri1 20030201 7889505 2994648
      eri0 20030202 4512205 2994518
      eri1 20030202 4912587 3009899

      Would the clustering be easier if I sorted the data by interface (the
      eri# is the interface)? Do I need to read the do some sort of
      looping to pass through the data a second time?

      The following is my code for the simple single interface stack data.
      I hope I can extrapolate on what I've got to handle multiple
      interfaces [note: sometimes I'll have three or more interfaces in my
      data files].

      THANKS IN ADVANCE FOR THROWING ME SOME BREAD CRUMBS!!!
      - Robin Duggar

      // date variables
      #call $setdatefmt( yyyymmdd )
      #set xmax = $todaysdate()
      #set xmin = $dateadd( @xmax, -7 )

      // Read and process data file using proc getdata
      #proc getdata
      file: eri1.tst
      fieldnames: interface datetime ipkts opkts
      showresults: yes

      // Set up plotting area using proc areadef
      #proc areadef
      title: Packets Passed by Interface (last 7 days)
      rectangle: 1 1 6 4
      xscaletype: date yyyymmdd
      xrange: @xmin @xmax
      yrange: datafield=3,4 combomode=stack
      xaxis.stubs: inc 1
      xaxis.label: Dates
      xaxis.stubformat: yyyymmdd
      yaxis.stubs: inc 500000
      yaxis.label: packets


      // Draw bars using proc bars
      #proc bars
      lenfield: 3
      locfield: 2
      color: magenta
      outline: no
      legendlabel: ipkts
      barwidth: 0.25
      #saveas B

      // Draw second level bars
      #proc bars
      lenfield: 4
      locfield: 2
      color: blue
      outline: no
      legendlabel: opkts
      barwidth: 0.25
      stackfields: *


      // render legend using lables defined above
      #proc legend
      location: min+0.3 max
      reverseorder: yes
      seglen: 0.3
    • Stephen C. Grubb
      Robin, the following script should do what you want. It uses clustering and a simple loop, and should be scalable to additional interfaces if desired. The
      Message 2 of 4 , Feb 12, 2003
      • 0 Attachment
        Robin,
        the following script should do what you want. It uses clustering
        and a simple loop, and should be scalable to additional interfaces if
        desired. The problem then becomes how to label the interfaces, but I'll
        leave this up to you. -Steve


        // date variables
        #call $setdatefmt( yyyymmdd )

        // #set xmax = $todaysdate()
        #set xmax = 20030203

        #set xmin = $dateadd( @xmax, -7 )

        // Read and process data file using proc getdata
        #proc getdata
        // file: eri1.tst
        data:
        eri0 20030201 4502505 2304593
        eri1 20030201 7889505 2994648
        eri0 20030202 4512205 2994518
        eri1 20030202 4912587 3009899

        fieldnames: interface datetime ipkts opkts
        showresults: yes

        // Set up plotting area using proc areadef
        #proc areadef
        title: Packets Passed by Interface (last 7 days)
        rectangle: 1 1 6 4
        xscaletype: date yyyymmdd
        xrange: @xmin @xmax
        yrange: datafield=3,4 combomode=stack
        xaxis.stubs: inc 1
        xaxis.label: Dates
        xaxis.stubformat: mmmdd
        yaxis.stubs: inc 5 100000
        yaxis.label: packets

        #set iclust = 1
        #for i in eri0,eri1

        // Draw bars using proc bars
        #proc bars
        select: @@interface = @i
        lenfield: ipkts
        locfield: datetime
        color: magenta
        outline: no
        #if @iclust = 1
        legendlabel: ipkts
        #endif
        barwidth: 0.1
        cluster: @iclust / 2
        clustersep: 0.02

        // Draw second level bars
        #proc bars
        select: @@interface = @i
        lenfield: opkts
        locfield: datetime
        color: blue
        outline: no
        #if @iclust = 1
        legendlabel: opkts
        #endif
        barwidth: 0.1
        cluster: @iclust / 2
        clustersep: 0.02
        stackfields: ipkts

        #set iclust = $arith( @iclust+1 )

        #endloop


        // render legend using lables defined above
        #proc legend
        location: min+0.3 max
        reverseorder: yes
        seglen: 0.3


        ----------------------------

        On Wed, 5 Feb 2003, Robin Duggar <rduggar@...> wrote:

        > Steve,
        >
        > I've looked at all the examples, and played around a bit. However, I
        > can't seem to find the way to do something. Please help.
        >
        > I need to graph the number of packets passed inbound & outbound on
        > each interface of a server, by day. Each interface is a stack with
        > its inbound & outbound layers. I have figured out how to do this for
        > a file with just one interface's data in it. However, I would like
        > to cluster the stacks for each interface by day.
        >
        > My data currently looks like this:
        >
        > eri0 20030201 4502505 2304593
        > eri1 20030201 7889505 2994648
        > eri0 20030202 4512205 2994518
        > eri1 20030202 4912587 3009899
        >
        > Would the clustering be easier if I sorted the data by interface (the
        > eri# is the interface)? Do I need to read the do some sort of
        > looping to pass through the data a second time?
        >
        > The following is my code for the simple single interface stack data.
        > I hope I can extrapolate on what I've got to handle multiple
        > interfaces [note: sometimes I'll have three or more interfaces in my
        > data files].
        >
        > THANKS IN ADVANCE FOR THROWING ME SOME BREAD CRUMBS!!!
        > - Robin Duggar
        >
        > // date variables
        > #call $setdatefmt( yyyymmdd )
        > #set xmax = $todaysdate()
        > #set xmin = $dateadd( @xmax, -7 )
        >
        > // Read and process data file using proc getdata
        > #proc getdata
        > file: eri1.tst
        > fieldnames: interface datetime ipkts opkts
        > showresults: yes
        >
        > // Set up plotting area using proc areadef
        > #proc areadef
        > title: Packets Passed by Interface (last 7 days)
        > rectangle: 1 1 6 4
        > xscaletype: date yyyymmdd
        > xrange: @xmin @xmax
        > yrange: datafield=3,4 combomode=stack
        > xaxis.stubs: inc 1
        > xaxis.label: Dates
        > xaxis.stubformat: yyyymmdd
        > yaxis.stubs: inc 500000
        > yaxis.label: packets
        >
        >
        > // Draw bars using proc bars
        > #proc bars
        > lenfield: 3
        > locfield: 2
        > color: magenta
        > outline: no
        > legendlabel: ipkts
        > barwidth: 0.25
        > #saveas B
        >
        > // Draw second level bars
        > #proc bars
        > lenfield: 4
        > locfield: 2
        > color: blue
        > outline: no
        > legendlabel: opkts
        > barwidth: 0.25
        > stackfields: *
        >
        >
        > // render legend using lables defined above
        > #proc legend
        > location: min+0.3 max
        > reverseorder: yes
        > seglen: 0.3
        >
      • Robin Duggar <rduggar@pobox.com>
        Steve, AWESOME!!! Now, I am trying to figure out how to use the getdata proc and the command function to populate the for i in ___ list. Can I assign the
        Message 3 of 4 , Feb 13, 2003
        • 0 Attachment
          Steve,

          AWESOME!!!

          Now, I am trying to figure out how to use the getdata proc and the
          command function to populate the "for i in ___ " list.

          Can I assign the output of the "command:" to a variable that I then
          reference in the "for i in ____" (like "for i in @MYLIST")?

          Kind of like this???

          #proc getdata
          data:
          command: cat eri.tst|cut -d" " -f1|sort -u
          #set ifacelist = @1

          And then, um, maybe like this ???

          #for i in @@ifacelist

          I know that I'm doing something wrong, because it doesn't work. Help


          THANKS TONS!
          - Robin


          --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...> wrote:
          > Robin,
          > the following script should do what you want. It uses clustering
          > and a simple loop, and should be scalable to additional interfaces
          if
          > desired. The problem then becomes how to label the interfaces, but
          I'll
          > leave this up to you. -Steve
          >
          >
          > // date variables
          > #call $setdatefmt( yyyymmdd )
          >
          > // #set xmax = $todaysdate()
          > #set xmax = 20030203
          >
          > #set xmin = $dateadd( @xmax, -7 )
          >
          > // Read and process data file using proc getdata
          > #proc getdata
          > // file: eri1.tst
          > data:
          > eri0 20030201 4502505 2304593
          > eri1 20030201 7889505 2994648
          > eri0 20030202 4512205 2994518
          > eri1 20030202 4912587 3009899
          >
          > fieldnames: interface datetime ipkts opkts
          > showresults: yes
          >
          > // Set up plotting area using proc areadef
          > #proc areadef
          > title: Packets Passed by Interface (last 7 days)
          > rectangle: 1 1 6 4
          > xscaletype: date yyyymmdd
          > xrange: @xmin @xmax
          > yrange: datafield=3,4 combomode=stack
          > xaxis.stubs: inc 1
          > xaxis.label: Dates
          > xaxis.stubformat: mmmdd
          > yaxis.stubs: inc 5 100000
          > yaxis.label: packets
          >
          > #set iclust = 1
          > #for i in eri0,eri1
          >
          > // Draw bars using proc bars
          > #proc bars
          > select: @@interface = @i
          > lenfield: ipkts
          > locfield: datetime
          > color: magenta
          > outline: no
          > #if @iclust = 1
          > legendlabel: ipkts
          > #endif
          > barwidth: 0.1
          > cluster: @iclust / 2
          > clustersep: 0.02
          >
          > // Draw second level bars
          > #proc bars
          > select: @@interface = @i
          > lenfield: opkts
          > locfield: datetime
          > color: blue
          > outline: no
          > #if @iclust = 1
          > legendlabel: opkts
          > #endif
          > barwidth: 0.1
          > cluster: @iclust / 2
          > clustersep: 0.02
          > stackfields: ipkts
          >
          > #set iclust = $arith( @iclust+1 )
          >
          > #endloop
          >
          >
          > // render legend using lables defined above
          > #proc legend
          > location: min+0.3 max
          > reverseorder: yes
          > seglen: 0.3
          >
          >
          > ----------------------------
          >
          > On Wed, 5 Feb 2003, Robin Duggar <rduggar@p...> wrote:
          >
          > > Steve,
          > >
          > > I've looked at all the examples, and played around a bit.
          However, I
          > > can't seem to find the way to do something. Please help.
          > >
          > > I need to graph the number of packets passed inbound & outbound
          on
          > > each interface of a server, by day. Each interface is a stack
          with
          > > its inbound & outbound layers. I have figured out how to do this
          for
          > > a file with just one interface's data in it. However, I would
          like
          > > to cluster the stacks for each interface by day.
          > >
          > > My data currently looks like this:
          > >
          > > eri0 20030201 4502505 2304593
          > > eri1 20030201 7889505 2994648
          > > eri0 20030202 4512205 2994518
          > > eri1 20030202 4912587 3009899
          > >
          > > Would the clustering be easier if I sorted the data by interface
          (the
          > > eri# is the interface)? Do I need to read the do some sort of
          > > looping to pass through the data a second time?
          > >
          > > The following is my code for the simple single interface stack
          data.
          > > I hope I can extrapolate on what I've got to handle multiple
          > > interfaces [note: sometimes I'll have three or more interfaces in
          my
          > > data files].
          > >
          > > THANKS IN ADVANCE FOR THROWING ME SOME BREAD CRUMBS!!!
          > > - Robin Duggar
          > >
          > > // date variables
          > > #call $setdatefmt( yyyymmdd )
          > > #set xmax = $todaysdate()
          > > #set xmin = $dateadd( @xmax, -7 )
          > >
          > > // Read and process data file using proc getdata
          > > #proc getdata
          > > file: eri1.tst
          > > fieldnames: interface datetime ipkts opkts
          > > showresults: yes
          > >
          > > // Set up plotting area using proc areadef
          > > #proc areadef
          > > title: Packets Passed by Interface (last 7 days)
          > > rectangle: 1 1 6 4
          > > xscaletype: date yyyymmdd
          > > xrange: @xmin @xmax
          > > yrange: datafield=3,4 combomode=stack
          > > xaxis.stubs: inc 1
          > > xaxis.label: Dates
          > > xaxis.stubformat: yyyymmdd
          > > yaxis.stubs: inc 500000
          > > yaxis.label: packets
          > >
          > >
          > > // Draw bars using proc bars
          > > #proc bars
          > > lenfield: 3
          > > locfield: 2
          > > color: magenta
          > > outline: no
          > > legendlabel: ipkts
          > > barwidth: 0.25
          > > #saveas B
          > >
          > > // Draw second level bars
          > > #proc bars
          > > lenfield: 4
          > > locfield: 2
          > > color: blue
          > > outline: no
          > > legendlabel: opkts
          > > barwidth: 0.25
          > > stackfields: *
          > >
          > >
          > > // render legend using lables defined above
          > > #proc legend
          > > location: min+0.3 max
          > > reverseorder: yes
          > > seglen: 0.3
          > >
        • Stephen C. Grubb
          Robin, No, you can t do that. You can do something like this however: #shell #processrows cat eri.tst|cut -d -f1|sort -u #endshell #while $shellrow( iface )
          Message 4 of 4 , Feb 17, 2003
          • 0 Attachment
            Robin,

            No, you can't do that.


            You can do something like this however:

            #shell #processrows
            cat eri.tst|cut -d" " -f1|sort -u
            #endshell

            #while $shellrow( iface )

            #proc getdata
            select: @@1 = iface

            ...

            #endloop


            This is still somewhat convoluted, and I'm not sure exactly what you're
            trying to do, but it should provide a start.

            -Steve


            On Thu, 13 Feb 2003, Robin Duggar <rduggar@...> wrote:

            > Steve,
            >
            > AWESOME!!!
            >
            > Now, I am trying to figure out how to use the getdata proc and the
            > command function to populate the "for i in ___ " list.
            >
            > Can I assign the output of the "command:" to a variable that I then
            > reference in the "for i in ____" (like "for i in @MYLIST")?
            >
            > Kind of like this???
            >
            > #proc getdata
            > data:
            > command: cat eri.tst|cut -d" " -f1|sort -u
            > #set ifacelist = @1
            >
            > And then, um, maybe like this ???
            >
            > #for i in @@ifacelist
            >
            > I know that I'm doing something wrong, because it doesn't work. Help
            >
            >
            > THANKS TONS!
            > - Robin
            >
            >
            > --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...> wrote:
            > > Robin,
            > > the following script should do what you want. It uses clustering
            > > and a simple loop, and should be scalable to additional interfaces
            > if
            > > desired. The problem then becomes how to label the interfaces, but
            > I'll
            > > leave this up to you. -Steve
            > >
            > >
            > > // date variables
            > > #call $setdatefmt( yyyymmdd )
            > >
            > > // #set xmax = $todaysdate()
            > > #set xmax = 20030203
            > >
            > > #set xmin = $dateadd( @xmax, -7 )
            > >
            > > // Read and process data file using proc getdata
            > > #proc getdata
            > > // file: eri1.tst
            > > data:
            > > eri0 20030201 4502505 2304593
            > > eri1 20030201 7889505 2994648
            > > eri0 20030202 4512205 2994518
            > > eri1 20030202 4912587 3009899
            > >
            > > fieldnames: interface datetime ipkts opkts
            > > showresults: yes
            > >
            > > // Set up plotting area using proc areadef
            > > #proc areadef
            > > title: Packets Passed by Interface (last 7 days)
            > > rectangle: 1 1 6 4
            > > xscaletype: date yyyymmdd
            > > xrange: @xmin @xmax
            > > yrange: datafield=3,4 combomode=stack
            > > xaxis.stubs: inc 1
            > > xaxis.label: Dates
            > > xaxis.stubformat: mmmdd
            > > yaxis.stubs: inc 5 100000
            > > yaxis.label: packets
            > >
            > > #set iclust = 1
            > > #for i in eri0,eri1
            > >
            > > // Draw bars using proc bars
            > > #proc bars
            > > select: @@interface = @i
            > > lenfield: ipkts
            > > locfield: datetime
            > > color: magenta
            > > outline: no
            > > #if @iclust = 1
            > > legendlabel: ipkts
            > > #endif
            > > barwidth: 0.1
            > > cluster: @iclust / 2
            > > clustersep: 0.02
            > >
            > > // Draw second level bars
            > > #proc bars
            > > select: @@interface = @i
            > > lenfield: opkts
            > > locfield: datetime
            > > color: blue
            > > outline: no
            > > #if @iclust = 1
            > > legendlabel: opkts
            > > #endif
            > > barwidth: 0.1
            > > cluster: @iclust / 2
            > > clustersep: 0.02
            > > stackfields: ipkts
            > >
            > > #set iclust = $arith( @iclust+1 )
            > >
            > > #endloop
            > >
            > >
            > > // render legend using lables defined above
            > > #proc legend
            > > location: min+0.3 max
            > > reverseorder: yes
            > > seglen: 0.3
            > >
            > >
            > > ----------------------------
            > >
            > > On Wed, 5 Feb 2003, Robin Duggar <rduggar@p...> wrote:
            > >
            > > > Steve,
            > > >
            > > > I've looked at all the examples, and played around a bit.
            > However, I
            > > > can't seem to find the way to do something. Please help.
            > > >
            > > > I need to graph the number of packets passed inbound & outbound
            > on
            > > > each interface of a server, by day. Each interface is a stack
            > with
            > > > its inbound & outbound layers. I have figured out how to do this
            > for
            > > > a file with just one interface's data in it. However, I would
            > like
            > > > to cluster the stacks for each interface by day.
            > > >
            > > > My data currently looks like this:
            > > >
            > > > eri0 20030201 4502505 2304593
            > > > eri1 20030201 7889505 2994648
            > > > eri0 20030202 4512205 2994518
            > > > eri1 20030202 4912587 3009899
            > > >
            > > > Would the clustering be easier if I sorted the data by interface
            > (the
            > > > eri# is the interface)? Do I need to read the do some sort of
            > > > looping to pass through the data a second time?
            > > >
            > > > The following is my code for the simple single interface stack
            > data.
            > > > I hope I can extrapolate on what I've got to handle multiple
            > > > interfaces [note: sometimes I'll have three or more interfaces in
            > my
            > > > data files].
            > > >
            > > > THANKS IN ADVANCE FOR THROWING ME SOME BREAD CRUMBS!!!
            > > > - Robin Duggar
            > > >
            > > > // date variables
            > > > #call $setdatefmt( yyyymmdd )
            > > > #set xmax = $todaysdate()
            > > > #set xmin = $dateadd( @xmax, -7 )
            > > >
            > > > // Read and process data file using proc getdata
            > > > #proc getdata
            > > > file: eri1.tst
            > > > fieldnames: interface datetime ipkts opkts
            > > > showresults: yes
            > > >
            > > > // Set up plotting area using proc areadef
            > > > #proc areadef
            > > > title: Packets Passed by Interface (last 7 days)
            > > > rectangle: 1 1 6 4
            > > > xscaletype: date yyyymmdd
            > > > xrange: @xmin @xmax
            > > > yrange: datafield=3,4 combomode=stack
            > > > xaxis.stubs: inc 1
            > > > xaxis.label: Dates
            > > > xaxis.stubformat: yyyymmdd
            > > > yaxis.stubs: inc 500000
            > > > yaxis.label: packets
            > > >
            > > >
            > > > // Draw bars using proc bars
            > > > #proc bars
            > > > lenfield: 3
            > > > locfield: 2
            > > > color: magenta
            > > > outline: no
            > > > legendlabel: ipkts
            > > > barwidth: 0.25
            > > > #saveas B
            > > >
            > > > // Draw second level bars
            > > > #proc bars
            > > > lenfield: 4
            > > > locfield: 2
            > > > color: blue
            > > > outline: no
            > > > legendlabel: opkts
            > > > barwidth: 0.25
            > > > stackfields: *
            > > >
            > > >
            > > > // render legend using lables defined above
            > > > #proc legend
            > > > location: min+0.3 max
            > > > reverseorder: yes
            > > > seglen: 0.3
            > > >
            >
            >
            >
            > To unsubscribe from this group, send an email to:
            > ploticus-unsubscribe@yahoogroups.com
            >
            >
            >
            > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            >
            >
            >


            Stephen C. Grubb scg@...
            Scientific Software Engineer, The Jackson Laboratory
            600 Main Street Bar Harbor, Maine 04609 USA
          Your message has been successfully submitted and would be delivered to recipients shortly.