Ens, EnsLib and EnsPortal are system packages, developes can subclass them.

To get class count call something like this:

SELECT 
  count(ID)
FROM %Dictionary.ClassDefinition
WHERE 1=1 AND
      System = 0 AND 
      NOT (Name %STARTSWITH '%' OR 
           Name %STARTSWITH 'Ens.' OR 
           Name %STARTSWITH 'EnsLib.' OR 
           Name %STARTSWITH 'EnsPortal.' OR 
           Name %STARTSWITH 'HS.' OR 
           Name %STARTSWITH 'SchemaMap')

Missing: SQL way to filter out mapped classes.

Use a Business Service with a basic Ens.InboundAdapter:

Class test.BS Extends Ens.BusinessService
{

Parameter ADAPTER = "Ens.InboundAdapter";

Method OnProcessInput(pInput As %RegisteredObject, Output pOutput As %RegisteredObject) As %Status
{
	$$$LOGINFO("In OnProcessInput")
	Quit $$$OK
}

}

Add it to production and set Call Interval to X seconds (and Pool Size to 1). That would ensure OnProcessInput being called every X seconds after it's last completion.

Say you have this string:

1111111111:authoredOn=ge2022-01-10:authoredOn=le2022-01-13

How do you want to slice it:

authoredOn=ge2022-01-10

authoredOn=le2022-01-13

what's 1111111111 doing there?

Something like this should work:

set str = "1111111111:authoredOn=ge2022-01-10:authoredOn=le2022-01-13"
set str = $lfs(str, ":")
for i=1:1:$ll(str) {
	set param = $lg(str,i)
	if $l(param,"=")=2 {
		set key = $p(param,"=",1)
		set value = $p(param,"=",2)
		set params(key, $i(params(key)))=value
	}
}
zw params