added scalex metric format
fixed port obtaining code