Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$max pukes on integer arrays #17

Open
mikedewar opened this issue Apr 15, 2014 · 1 comment
Open

$max pukes on integer arrays #17

mikedewar opened this issue Apr 15, 2014 · 1 comment

Comments

@mikedewar
Copy link
Collaborator

on recieving ints:

panic: interface conversion: interface is int, not float64

goroutine 1811 [running]:
runtime.panic(0x3cfca0, 0xc2102689c0)
    /usr/local/go/src/pkg/runtime/panic.c:266 +0xb6
github.com/nytlabs/gojee.func·030(0x316260, 0xc2102cd580, 0xc2102c3590, 0x4, 0xc21005d4e8, ...)
    /Users/mikedewar/go/src/github.com/nytlabs/gojee/jee.go:622 +0xb9
github.com/nytlabs/gojee.Eval(0xc2102e7000, 0x327ee0, 0xc21009aea0, 0x21609, 0xc2102c36b0, ...)
    /Users/mikedewar/go/src/github.com/nytlabs/gojee/jee.go:1089 +0x2661
github.com/nytlabs/gojee.Eval(0xc2102b9180, 0x327ee0, 0xc21009aea0, 0xc2102b9180, 0xc210239901, ...)
    /Users/mikedewar/go/src/github.com/nytlabs/gojee/jee.go:1112 +0x2d24
github.com/nytlabs/streamtools/st/library.evalMap(0xc2101f9c90, 0xc21009aea0, 0xc2101f9c90, 0xc2101f9c90, 0x329020)
    /Users/mikedewar/go/src/github.com/nytlabs/streamtools/st/library/map.go:62 +0x2bd
github.com/nytlabs/streamtools/st/library.(*Map).Run(0xc21014cbb0)
    /Users/mikedewar/go/src/github.com/nytlabs/streamtools/st/library/map.go:154 +0x57c
created by github.com/nytlabs/streamtools/st/blocks.BlockRoutine
    /Users/mikedewar/go/src/github.com/nytlabs/streamtools/st/blocks/blocks.go:202 +0xef

To recreate in streamtools:

{
  "Connections": [
    {
      "ToRoute": "poll",
      "ToId": "2",
      "FromId": "5",
      "Id": "6"
    },
    {
      "ToRoute": "in",
      "ToId": "3",
      "FromId": "2",
      "Id": "7"
    },
    {
      "ToRoute": "in",
      "ToId": "4",
      "FromId": "3",
      "Id": "8"
    },
    {
      "ToRoute": "poll",
      "ToId": "4",
      "FromId": "9",
      "Id": "10"
    }
  ],
  "Blocks": [
    {
      "Position": {
        "Y": 646,
        "X": 370
      },
      "Rule": {
        "Map": {
          "foo": "$max(.Histogram[].Count)"
        },
        "Additive": true
      },
      "Type": "map",
      "Id": "1"
    },
    {
      "Position": {
        "Y": 247,
        "X": 355
      },
      "Rule": {
        "Rate": 1
      },
      "Type": "poisson",
      "Id": "2"
    },
    {
      "Position": {
        "Y": 378,
        "X": 411
      },
      "Rule": {
        "Map": {
          "sample": "$str(.sample)"
        },
        "Additive": true
      },
      "Type": "map",
      "Id": "3"
    },
    {
      "Position": {
        "Y": 511,
        "X": 436
      },
      "Rule": {
        "Window": "10s",
        "Path": ".sample"
      },
      "Type": "histogram",
      "Id": "4"
    },
    {
      "Position": {
        "Y": 153,
        "X": 309
      },
      "Rule": {
        "Interval": "1s"
      },
      "Type": "ticker",
      "Id": "5"
    },
    {
      "Position": {
        "Y": 404,
        "X": 575
      },
      "Rule": {
        "Interval": "1s"
      },
      "Type": "ticker",
      "Id": "9"
    }
  ]
}
@nikhan
Copy link
Collaborator

nikhan commented Apr 15, 2014

it shouldn't panic, but as of right now gojee doesn't do anything with ints at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants