This functionality is modeled in the XML file provided in Using an .edmx File. By surfacing the PsqlConnectionStatistics and PsqlStatus entities, you can quickly model this code using the standard tooling.
See Obtaining Connection Statistics for more information about the data provider’s support for connection statistics.