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

[field formatters] Human readable duration format shows zero for non-zero numbers #176112

Closed
Tracked by #163011
mattkime opened this issue Feb 1, 2024 · 3 comments
Closed
Tracked by #163011
Labels
Feature:FieldFormatters Icebox impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)

Comments

@mattkime
Copy link
Contributor

mattkime commented Feb 1, 2024

The human readable duration formatter fails for nanoseconds. Milliseconds is the smallest unit human readable supports which means nanosecond values are often rounded down to 0.00.

1234 nanoseconds would be shown as 0.001234 milliseconds

1234 nanoseconds becomes 0.00 milliseconds. More decimals can be displayed - 0.001234 milliseconds - but micro or nanoseconds would be preferred.

1 microsecond could have the same problem.

Our code relies on Moment js which seems to be the limiting factor. Its no longer maintained. A requirement for the replacement is representing nanoseconds - a brief glimpse reveals that few support this.

Split from - #176112

@mattkime mattkime added loe:needs-research This issue requires some research before it can be worked on or estimated Feature:FieldFormatters impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) labels Feb 1, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

mattkime added a commit that referenced this issue Feb 6, 2024
…4973)

## Summary

Default field formatters based on field meta units data.

Note: the smallest unit our formatter will show is milliseconds which
means micro and nanoseconds may round down to zero for smaller values.
#176112


Closes: #82318

Mapping and doc setup for testing - 

```
PUT my-index-000001

PUT my-index-000001/_mapping
{
    "properties": {
            "nanos": {
        "type": "long",
        "meta": {
          "unit": "nanos"
        }
      },
            "micros": {
        "type": "long",
        "meta": {
          "unit": "micros"
        }
      },
      "ms": {
        "type": "long",
        "meta": {
          "unit": "ms"
        }
      },
                  "second": {
        "type": "long",
        "meta": {
          "unit": "s"
        }
      },
                  "minute": {
        "type": "long",
        "meta": {
          "unit": "m"
        }
      },
                  "hour": {
        "type": "long",
        "meta": {
          "unit": "h"
        }
      },
                  "day": {
        "type": "long",
        "meta": {
          "unit": "d"
        }
      },
      "percent": {
        "type": "long",
        "meta": {
          "unit": "percent"
        }
      },
            "bytes": {
        "type": "long",
        "meta": {
          "unit": "byte"
        }
      }
    }
}

POST my-index-000001/_doc
{
  "nanos" : 1234.5,
  "micros" : 1234.5,
  "ms" : 1234.5,
  "second" : 1234.5,
  "minute" : 1234.5,
  "hour" : 1234.5,
  "day" : 1234.5,
  "percent" : 1234.5,
  "bytes" : 1234.5
}

```
fkanout pushed a commit to fkanout/kibana that referenced this issue Feb 7, 2024
…stic#174973)

## Summary

Default field formatters based on field meta units data.

Note: the smallest unit our formatter will show is milliseconds which
means micro and nanoseconds may round down to zero for smaller values.
elastic#176112


Closes: elastic#82318

Mapping and doc setup for testing - 

```
PUT my-index-000001

PUT my-index-000001/_mapping
{
    "properties": {
            "nanos": {
        "type": "long",
        "meta": {
          "unit": "nanos"
        }
      },
            "micros": {
        "type": "long",
        "meta": {
          "unit": "micros"
        }
      },
      "ms": {
        "type": "long",
        "meta": {
          "unit": "ms"
        }
      },
                  "second": {
        "type": "long",
        "meta": {
          "unit": "s"
        }
      },
                  "minute": {
        "type": "long",
        "meta": {
          "unit": "m"
        }
      },
                  "hour": {
        "type": "long",
        "meta": {
          "unit": "h"
        }
      },
                  "day": {
        "type": "long",
        "meta": {
          "unit": "d"
        }
      },
      "percent": {
        "type": "long",
        "meta": {
          "unit": "percent"
        }
      },
            "bytes": {
        "type": "long",
        "meta": {
          "unit": "byte"
        }
      }
    }
}

POST my-index-000001/_doc
{
  "nanos" : 1234.5,
  "micros" : 1234.5,
  "ms" : 1234.5,
  "second" : 1234.5,
  "minute" : 1234.5,
  "hour" : 1234.5,
  "day" : 1234.5,
  "percent" : 1234.5,
  "bytes" : 1234.5
}

```
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this issue Feb 15, 2024
…stic#174973)

## Summary

Default field formatters based on field meta units data.

Note: the smallest unit our formatter will show is milliseconds which
means micro and nanoseconds may round down to zero for smaller values.
elastic#176112


Closes: elastic#82318

Mapping and doc setup for testing - 

```
PUT my-index-000001

PUT my-index-000001/_mapping
{
    "properties": {
            "nanos": {
        "type": "long",
        "meta": {
          "unit": "nanos"
        }
      },
            "micros": {
        "type": "long",
        "meta": {
          "unit": "micros"
        }
      },
      "ms": {
        "type": "long",
        "meta": {
          "unit": "ms"
        }
      },
                  "second": {
        "type": "long",
        "meta": {
          "unit": "s"
        }
      },
                  "minute": {
        "type": "long",
        "meta": {
          "unit": "m"
        }
      },
                  "hour": {
        "type": "long",
        "meta": {
          "unit": "h"
        }
      },
                  "day": {
        "type": "long",
        "meta": {
          "unit": "d"
        }
      },
      "percent": {
        "type": "long",
        "meta": {
          "unit": "percent"
        }
      },
            "bytes": {
        "type": "long",
        "meta": {
          "unit": "byte"
        }
      }
    }
}

POST my-index-000001/_doc
{
  "nanos" : 1234.5,
  "micros" : 1234.5,
  "ms" : 1234.5,
  "second" : 1234.5,
  "minute" : 1234.5,
  "hour" : 1234.5,
  "day" : 1234.5,
  "percent" : 1234.5,
  "bytes" : 1234.5
}

```
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this issue Feb 15, 2024
…stic#174973)

## Summary

Default field formatters based on field meta units data.

Note: the smallest unit our formatter will show is milliseconds which
means micro and nanoseconds may round down to zero for smaller values.
elastic#176112


Closes: elastic#82318

Mapping and doc setup for testing - 

```
PUT my-index-000001

PUT my-index-000001/_mapping
{
    "properties": {
            "nanos": {
        "type": "long",
        "meta": {
          "unit": "nanos"
        }
      },
            "micros": {
        "type": "long",
        "meta": {
          "unit": "micros"
        }
      },
      "ms": {
        "type": "long",
        "meta": {
          "unit": "ms"
        }
      },
                  "second": {
        "type": "long",
        "meta": {
          "unit": "s"
        }
      },
                  "minute": {
        "type": "long",
        "meta": {
          "unit": "m"
        }
      },
                  "hour": {
        "type": "long",
        "meta": {
          "unit": "h"
        }
      },
                  "day": {
        "type": "long",
        "meta": {
          "unit": "d"
        }
      },
      "percent": {
        "type": "long",
        "meta": {
          "unit": "percent"
        }
      },
            "bytes": {
        "type": "long",
        "meta": {
          "unit": "byte"
        }
      }
    }
}

POST my-index-000001/_doc
{
  "nanos" : 1234.5,
  "micros" : 1234.5,
  "ms" : 1234.5,
  "second" : 1234.5,
  "minute" : 1234.5,
  "hour" : 1234.5,
  "day" : 1234.5,
  "percent" : 1234.5,
  "bytes" : 1234.5
}

```
fkanout pushed a commit to fkanout/kibana that referenced this issue Mar 4, 2024
…stic#174973)

## Summary

Default field formatters based on field meta units data.

Note: the smallest unit our formatter will show is milliseconds which
means micro and nanoseconds may round down to zero for smaller values.
elastic#176112


Closes: elastic#82318

Mapping and doc setup for testing - 

```
PUT my-index-000001

PUT my-index-000001/_mapping
{
    "properties": {
            "nanos": {
        "type": "long",
        "meta": {
          "unit": "nanos"
        }
      },
            "micros": {
        "type": "long",
        "meta": {
          "unit": "micros"
        }
      },
      "ms": {
        "type": "long",
        "meta": {
          "unit": "ms"
        }
      },
                  "second": {
        "type": "long",
        "meta": {
          "unit": "s"
        }
      },
                  "minute": {
        "type": "long",
        "meta": {
          "unit": "m"
        }
      },
                  "hour": {
        "type": "long",
        "meta": {
          "unit": "h"
        }
      },
                  "day": {
        "type": "long",
        "meta": {
          "unit": "d"
        }
      },
      "percent": {
        "type": "long",
        "meta": {
          "unit": "percent"
        }
      },
            "bytes": {
        "type": "long",
        "meta": {
          "unit": "byte"
        }
      }
    }
}

POST my-index-000001/_doc
{
  "nanos" : 1234.5,
  "micros" : 1234.5,
  "ms" : 1234.5,
  "second" : 1234.5,
  "minute" : 1234.5,
  "hour" : 1234.5,
  "day" : 1234.5,
  "percent" : 1234.5,
  "bytes" : 1234.5
}

```
@kertal kertal added the Icebox label Sep 18, 2024
@kertal
Copy link
Member

kertal commented Sep 18, 2024

Closing this because it's not planned to be resolved in the foreseeable future. It will be tracked in our Icebox and will be re-opened if our priorities change. Feel free to re-open if you think it should be melted sooner.

@kertal kertal closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:FieldFormatters Icebox impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)
Projects
None yet
Development

No branches or pull requests

4 participants