[ZBX-10373] incorrect screenitem x, y update Created: 2016 Feb 11 Updated: 2024 Apr 10 Resolved: 2018 Jun 29 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A) |
Affects Version/s: | 3.0.0rc1 |
Fix Version/s: | 3.0.9rc1, 3.2.5rc1, 3.4.0alpha1 |
Type: | Incident report | Priority: | Major |
Reporter: | vitalijs.cemeris (Inactive) | Assignee: | Gregory Chalenko |
Resolution: | Fixed | Votes: | 0 |
Labels: | screenitem, update | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: | ZBX-10373.png zbx-10373.csv |
Team: | Team D |
Team: | Team D |
Sprint: | Sprint 3, Sprint 4, Sprint 5, Sprint 36, Sprint 37 |
Story Points: | 0.5 |
Description |
Reproduce: Note: |
Comments |
Comment by richlv [ 2016 Feb 11 ] |
can this be considered yet another case of ZBX-3783 ? |
Comment by Gunars Pujats (Inactive) [ 2016 Feb 18 ] |
RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-10373 |
Comment by Alexander Vladishev [ 2016 Mar 08 ] |
(4) Why SQL requests have been replaced with API? It must be tested for performance issues. @@ -152,14 +152,14 @@ $screenIds = zbx_objectValues($screenItems, 'screenid'); // fetch the items we're updating - $dbScreenItems = API::getApi()->select('screens_items', array( + $dbScreenItems = $this->get(array( 'screenids' => $screenIds, 'output' => API_OUTPUT_EXTEND, 'preservekeys' => true )); - $screens = API::getApi()->select('screens', array( - 'output' => array('screenid', 'hsize', 'vsize'), + $screens = API::Screen()->get(array( + 'output' => array('screenid', 'hsize', 'vsize', 'name'), 'screenids' => $screenIds, 'preservekeys' => true )); @@ -230,8 +221,8 @@ } $screenItemIds = zbx_objectValues($screenItems, 'screenitemid'); - $screens = API::getApi()->select('screens', array( - 'output' => array('screenid', 'hsize', 'vsize'), + $screens = API::Screen()->get(array( + 'output' => array('screenid', 'hsize', 'vsize', 'name'), 'screenitemids' => $screenItemIds, 'preservekeys' => true )); @@ -247,14 +238,16 @@ // old validation // fetch the items we're updating - $dbScreenItems = API::getApi()->select('screens_items', array( - 'screenitemids' => $screenItemIds, + $dbScreenItems = $this->get(array( 'output' => API_OUTPUT_EXTEND, + 'screenids' => zbx_objectValues($screens, 'screenid'), 'preservekeys' => true )); oleg.egorov REVIEWED by gcalenko CLOSED |
Comment by Gregory Chalenko [ 2017 Mar 20 ] |
Changes: - $dbScreenItems = API::getApi()->select('screens_items', array( + $dbScreenItems = $this->get(array( Not critical, class CScreenItem contains method get which uses requests SQL, not API. |
Comment by Gregory Chalenko [ 2017 Mar 20 ] |
Change: - $screens = API::getApi()->select('screens', array( - 'output' => array('screenid', 'hsize', 'vsize'), + $screens = API::Screen()->get(array( + 'output' => array('screenid', 'hsize', 'vsize', 'name'), Have impact on performance ~0.02sec for 300 request. Attached .csv file with performance test results, where 25 first rows contains measurement when API::Screen were called before SQL methods and next 25 rows contains measurements when API::Screen were called after SQL methods |
Comment by Gregory Chalenko [ 2017 Apr 04 ] |
Fixed in: svn://svn.zabbix.com/branches/dev/ZBX-10373 r67057 |
Comment by Alexander Vladishev [ 2017 Apr 04 ] |
(1) No translation strings changes gcalenko CLOSED |
Comment by Alexander Vladishev [ 2017 Apr 05 ] |
(2) [F] frontends/php/include/classes/api/services/CScreenItem.php:160: It will be more correct. The order of keys won't change when using + instead of array_merge() $screenItem += $defaults; gcalenko RESOLVED r67062 sasha CLOSED |
Comment by Alexander Vladishev [ 2017 Apr 05 ] |
(3) [F] Formatting issues
gcalenko RESOLVED r67072 sasha CLOSED with minor changes in r67099 |
Comment by Alexander Vladishev [ 2017 Apr 05 ] |
(4) [F] frontends/php/include/classes/api/services/CScreenItem.php:909: this will not work with different type of arrays (associative and indexed arrays) $screenItems = zbx_array_merge($dbScreenItems, $screenItems); gcalenko RESOLVED r67072 sasha CLOSED |
Comment by Alexander Vladishev [ 2017 Apr 06 ] |
Successfully tested! Have a look at my changes in r67099 before a merge. |
Comment by Gregory Chalenko [ 2017 Apr 10 ] |
Fixed in:
|
Comment by Ivo Kurzemnieks [ 2018 Feb 15 ] |
(5) [D]
gcalenko Updated documentation for screen.create example. RESOLVED iivs Great, but the only thing 4.0 example was not changed. CLOSED |