appclacks / mirabelle

A stream processing engine for monitoring
Eclipse Public License 1.0
95 stars 5 forks source link

Documentation stream example fails to compile #23

Closed faxm0dem closed 7 months ago

faxm0dem commented 7 months ago

The following stream from the documentation fails to compile:

(streams
  (stream {:name :http_requests_duration}
    (where [:= :service "http_requests_duration_seconds"]
      (info)
      (over 1.5
        (with :state "critical"
          (error))))))

Here's the output from 03d9a5b compilation:

☠ lein run compile /tmp/streams/source /tmp/streams/compiled
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
Reflection warning, /tmp/form-init5699684944365224467.clj:1:1082 - call to static method invokeStaticMethod on clojure.lang.Reflector can't be resolved (argument types: unknown, java.lang.String, unknown).
Reflection warning, mirabelle/output/influxdb.clj:66:7 - call to method addField on com.influxdb.client.write.Point can't be resolved (argument types: java.lang.String, unknown).
Reflection warning, mirabelle/output/influxdb.clj:66:7 - call to method addField on com.influxdb.client.write.Point can't be resolved (argument types: java.lang.String, unknown).
Reflection warning, mirabelle/pool.clj:14:5 - reference to field shutdown on java.util.concurrent.Executor can't be resolved.
Reflection warning, mirabelle/pool.clj:15:5 - call to method awaitTermination on java.util.concurrent.Executor can't be resolved (no such method).
Reflection warning, mirabelle/stream.clj:158:24 - reference to field isFile can't be resolved.
Reflection warning, byte_streams.clj:437:12 - call to method position on java.nio.ByteBuffer can't be resolved (argument types: unknown).
Reflection warning, byte_streams.clj:438:12 - call to method limit can't be resolved (target class is unknown).
Reflection warning, byte_streams.clj:715:19 - call to method limit on java.nio.ByteBuffer can't be resolved (argument types: java.lang.Number).
Reflection warning, byte_streams.clj:718:9 - call to method position on java.nio.ByteBuffer can't be resolved (argument types: java.lang.Number).
Reflection warning, mirabelle/transport.clj:49:3 - call to io.netty.channel.group.DefaultChannelGroup ctor can't be resolved.
Reflection warning, mirabelle/transport/tcp.clj:52:29 - reference to field channel can't be resolved.
10:41:51.590 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework
10:41:51.618 [main] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
10:41:51.618 [main] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 17
10:41:51.619 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
10:41:51.620 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
10:41:51.620 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.storeFence: available
10:41:51.621 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
10:41:51.621 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: unavailable: Reflective setAccessible(true) disabled
10:41:51.622 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true
10:41:51.622 [main] DEBUG io.netty.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable: class io.netty.util.internal.PlatformDependent0$7 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @11b03c1f
10:41:51.623 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, int): unavailable
10:41:51.623 [main] DEBUG io.netty.util.internal.PlatformDependent - sun.misc.Unsafe: available
10:41:51.633 [main] DEBUG io.netty.util.internal.PlatformDependent - maxDirectMemory: 8384413696 bytes (maybe)
10:41:51.633 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.tmpdir: /tmp (java.io.tmpdir)
10:41:51.633 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
10:41:51.634 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: -1 bytes
10:41:51.634 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1
10:41:51.636 [main] DEBUG io.netty.util.internal.CleanerJava9 - java.nio.ByteBuffer.cleaner(): available
10:41:51.636 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
Reflection warning, mirabelle/transport/tcp.clj:128:5 - reference to field pipeline can't be resolved.
Reflection warning, mirabelle/transport/tcp.clj:139:5 - reference to field pipeline can't be resolved.
Reflection warning, mirabelle/transport/tcp.clj:194:40 - reference to field pendingTasks can't be resolved.
Reflection warning, mirabelle/transport/tcp.clj:195:53 - reference to field iterator on java.lang.Object can't be resolved.
10:41:51.847 [main] INFO mirabelle.core - compiling streams
10:41:51.849 [main] INFO mirabelle.config - Compiling test.clj
Execution error (IllegalFormatConversionException) at java.util.Formatter$FormatSpecifier/failConversion (Formatter.java:4442).
d != clojure.lang.Ratio

Full report at:
/tmp/clojure-17488921368067574676.edn
faxm0dem commented 7 months ago

When I replace over 1.5 with over 15 it compiles

faxm0dem commented 7 months ago

Also, using 1.5 in compiled stream works at runtime

faxm0dem commented 7 months ago

Please also note that the error message is not very helpful:

Execution error (IllegalFormatConversionException) at java.util.Formatter$FormatSpecifier/failConversion (Formatter.java:4442).
d != clojure.lang.Ratio