external criterion, externalcriterion, kPMExternalCriterion — Criterion for judging an external executable sample.


external criterion structure { type, ... };
type : string, choice, default


Criterion for judging an external executable sample.

When an external executable exits, a criterion is needed to judge what the executable's result means. The best practice is to determine the result entirely on the exit code. This is fast and reliable.

Alternatively, the last few kilobytes of the executable's stdout or stderr can be interpreted or parsed for a numeric result.

Where possible avoid using stdout or stderr, because the interpretation requires reading from disk. This will slow down sampling times.



type is a string. If type is omitted, the default exit code is used. type must be one of the following three constants:

  • exit code, kPMExternalCriterionType_ExitCode.
  • interpret, kPMExternalCriterionType_Interpret.
  • contains, kPMExternalCriterionType_Contains.