Eduard Lebedyuk · Aug 18, 2022 go to post

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.

Eduard Lebedyuk · Aug 16, 2022 go to post

Yes.

Alternatively you can sync call some BO to make an API call, wait for a response and send that to DTL.

It might make sense if you already have a BO/some-other-preexisting-API-caller so you don't have to reimplement the API call code in BS.

Eduard Lebedyuk · Aug 15, 2022 go to post

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.

Eduard Lebedyuk · Aug 13, 2022 go to post

Can skip $Job, leaving just:

Do $System.Process.Terminate(,<desired error code>)

it would terminate the current job.

Question: are you using the error code? I'm always exiting with error code 1 in case of any errors, but is there an advantage in using some custom error codes here?

Eduard Lebedyuk · Aug 12, 2022 go to post

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
Eduard Lebedyuk · Aug 11, 2022 go to post

Thanks, Ben!

%XML.Exchange.Adaptor sounds great.

And you're right, I'm mainly talking about the easiest scenario where there is no id/data drift. There are certainly trickier situations, where unique identifiers are required.

Eduard Lebedyuk · Aug 11, 2022 go to post

Component status

Use Ens.Director to get enabled/disabled and status:

set enabled = ##class(Ens.Director).IsItemEnabled(bh, .status)

Queue depth

SELECT 
  Name, 
  Count, 
  Created, 
  Active
FROM EnsPortal.Queues_EnumerateQueues()

Last activity date

Do you see it in SMP somewhere?

Eduard Lebedyuk · Aug 10, 2022 go to post

I would start by observing the output of these two commands when run from a Dockerfile:
 

set sc = ##class(Ens.Director).SetAutoStart("GOJ.IrisApp.ProductionDev")
write $system.Status.GetErrorText(sc)
set sc = ##class(Ens.Director).StartProduction("GOJ.IrisApp.ProductionDev")
write $system.Status.GetErrorText(sc)
Eduard Lebedyuk · Aug 9, 2022 go to post

HS.SDA3.Container is a registered object and not a persistent one, so you can't pass it directly.

What you can do, however, is to pass existing stream id in your request, this way stream is not copied twice (you only pass an id) and receiver then can recreate the same HS.SDA3.Container from a stream.

Eduard Lebedyuk · Aug 4, 2022 go to post

For this type of data, you can make your own indexes for different parts and/or combinations of them: a separate date, a separate time, a separate year, a separate year and month, etc.

Could you elaborate on that, please?

Eduard Lebedyuk · Aug 3, 2022 go to post

That's a different connection (connection to remote gateway server), rather that a license/csp connection.

Check that %Java Server External Language Server can start. In your case it does not start.

We wait for 60 seconds because it can take a while for External Language Server to start - it can be on another server for example.

Calling @Benjamin De Boe.

Eduard Lebedyuk · Aug 2, 2022 go to post

Yes? Cubes need space to store thier copy of the facts and CPU is needed to build it all.

As I said above, using async reporting mirror for cubes would completely remove the impact on the patient index.

Eduard Lebedyuk · Jul 25, 2022 go to post

Yeah, the process had 64,5 Gb of virtual memory allocated and 40Gb actually used.

Not surprised OOM killed that.

Eduard Lebedyuk · Jul 25, 2022 go to post

That's InterSystems IRIS logs. You need OS logs, namely syslog (check /var/log/syslog or /var/log/messages). Search for log entries about the "killed process" around the time your process was killed.

To be extra sure run write $job before calling the query to get process id. It should match the id of a killed process.

After you establish that your process was killed by OOM you need to report that to WRC, as a fix probably requires if not access, then at least overview of the production configuration which causes it.