@@ -28,7 +28,6 @@ static FFI()
2828 free_response = Marshal . GetDelegateForFunctionPointer < FreeResponseDelegate > ( NativeLibLoader . LoadFunctionPointer ( _libHandle , "free_response" ) ) ;
2929
3030 // everything else has some special details to it
31- // if these get out of hand they'll need some refactor but for now 5 is fine
3231 take_state = Marshal . GetDelegateForFunctionPointer < TakeStateDelegate > (
3332 NativeLibLoader . LoadFunctionPointer ( _libHandle , "flat_take_state" ) ) ;
3433
@@ -43,6 +42,9 @@ static FFI()
4342
4443 get_metrics = Marshal . GetDelegateForFunctionPointer < GetMetricsDelegate > (
4544 NativeLibLoader . LoadFunctionPointer ( _libHandle , "flat_get_metrics" ) ) ;
45+
46+ collect_metrics = Marshal . GetDelegateForFunctionPointer < CollectMetricsDelegate > (
47+ NativeLibLoader . LoadFunctionPointer ( _libHandle , "flat_collect_metrics" ) ) ;
4648 }
4749
4850 // one delegate type to rule them all, lets us not have to deal with a ton of delegate types in the higher layers
@@ -64,6 +66,9 @@ static FFI()
6466 [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
6567 private delegate Buf GetMetricsDelegate ( IntPtr enginePtr ) ;
6668
69+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
70+ private delegate Buf CollectMetricsDelegate ( IntPtr enginePtr ) ;
71+
6772 [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
6873 private delegate IntPtr NewEngineDelegate ( ) ;
6974
@@ -96,6 +101,7 @@ static FFI()
96101 private static readonly ListKnownTogglesDelegate list_known_toggles ;
97102 private static readonly BuiltInStrategiesDelegate built_in_strategies ;
98103 private static readonly GetMetricsDelegate get_metrics ;
104+ private static readonly CollectMetricsDelegate collect_metrics ;
99105
100106 internal static Buf TakeState ( IntPtr ptr , string json )
101107 => take_state ( ptr , ToUtf8NullTerminated ( json ) ) ;
@@ -130,6 +136,8 @@ internal static Buf ObserveHistogram(IntPtr ptr, byte[] message)
130136
131137 internal static Buf GetMetrics ( IntPtr ptr ) => get_metrics ( ptr ) ;
132138
139+ internal static Buf CollectMetrics ( IntPtr ptr ) => collect_metrics ( ptr ) ;
140+
133141 internal static void FreeBuf ( Buf buf ) => free_buffer ( buf ) ;
134142
135143 internal static IntPtr NewEngine ( )
0 commit comments