[ 
https://issues.apache.org/jira/browse/IGNITE-11177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16765106#comment-16765106
 ] 

Aleksey Plekhanov commented on IGNITE-11177:
--------------------------------------------

[~pkouznet] you can also simplify test and remove reflection, by using 
something like this:

 
{code:java}
public void testDurationMetricsCanBeLonger24Hours() throws Exception {
    long LONG_DURATION_MS = TimeUnit.DAYS.toMillis(365);

    IgniteEx ignite = 
startGrid(getConfiguration().setMetricsUpdateFrequency(500L));

    GridJobMetricsProcessor jobMetricsProc = new 
GridJobMetricsProcessor(ignite.context()) {
        @Override public GridJobMetrics getJobMetrics() {
            return new GridJobMetrics() {
                @Override public long getTotalJobsExecutionTime() {
                    return LONG_DURATION_MS;
                }
            };
        }
    };

    ((GridKernalContextImpl)ignite.context()).add(jobMetricsProc);

    List<?> durationMetrics = execSql(ignite, "SELECT TOTAL_JOBS_EXECUTE_TIME 
FROM IGNITE.NODE_METRICS").get(0);

    assertEquals(LONG_DURATION_MS, durationMetrics.get(0));
}
{code}

> IGNITE.NODE_METRICS view fails with "Cannot parse "TIME" constant" > 24h
> ------------------------------------------------------------------------
>
>                 Key: IGNITE-11177
>                 URL: https://issues.apache.org/jira/browse/IGNITE-11177
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.7
>            Reporter: Ilya Kasnacheev
>            Assignee: Pavel Kuznetsov
>            Priority: Major
>              Labels: metrics
>             Fix For: 2.8
>
>
> This is because we are using TIME type for several additive measurements:
> {quote}SqlSystemViewNodeMetrics.class:
>                         
> valueTimeFromMillis(metrics.getTotalJobsExecutionTime()),
>                         valueTimeFromMillis(metrics.getTotalBusyTime()),
>                         
> valueTimeFromMillis(metrics.getTotalIdleTime()),{quote}
> which will be hundreds of hours on long-running cluster, but {{TIME}} type is 
> limited to 24 hours and will fail to be converted otherwise, as in:
> {quote}0: jdbc:ignite:thin://localhost> SELECT CAST('40:52:26.548' AS TIME);
> Error: Failed to parse query. Невозможно преобразование строки "40:52:26.548" 
> в тип "TIME"
> Cannot parse "TIME" constant "40:52:26.548"; SQL statement:
> SELECT CAST('40:52:26.548' AS TIME) [22007-197] (state=42000,code=1001){quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to